Results 1 to 10 of 10

Thread: swfaddress problem

  1. #1
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default swfaddress problem

    For some reason I can not figure out why my swf will not load correctly? It for some reason will not play from frame1, it skips to a later frame for some reason. Other than that it works perfect.

    AS Code on Frame 1:
    Code:
    // SWFAddress code
    #include "includes/SWFAddress.as"
    
    // Custom utilities
    function replace(str, find, replace) {
    	return str.split(find).join(replace);
    }
    function toTitleCase(str) {
    	return str.substr(0,1).toUpperCase() + str.substr(1).toLowerCase();
    }
    function getIndex(arr, obj) {
    	for (var i = 0; i < arr.length; i++) {
    		if (arr[i] == obj) {
    			return i;
    		}
    	}
    }
    function formatTitle(addr) {
    	if (addr.substr(addr.length - 1, 1) == '/') {
    		addr = addr.substr(0, addr.length - 1);
    	}
    	return 'STATUS COUTURE' + ((addr.length > 0) ? ' / ' + toTitleCase(replace(addr.substr(1), '/', ' / ')) : '');
    }
    // SWFAddress handling
    SWFAddress.onChange = function() {
    	var arr = new Array('', '/travel/', '/dining/', '/entertainment/', 
    			   '/shopping/', '/information/', '/event-planning/', '/connections/', 
    			   '/business-services/', '/lifestyle-management/', '/who-we-are/', '/what-we-do/',
    			   '/our-members/', '/contact-us/');
    	var addr = SWFAddress.getValue();
    	if (_currentframe == 1 && addr == '') {
    		play();
    	} else {
    		gotoAndPlay(126 + 17*getIndex(arr, addr));
    	}
    	SWFAddress.setTitle(formatTitle(addr));
    }
    
    _root.cursor_mc.swapDepths(1000);
    _root.onEnterFrame = function() {
    	Mouse.hide();
    	cursor_mc._x = _root._xmouse;
    	cursor_mc._y = _root._ymouse;
    }
    
    var buttonSound:Sound = new Sound();
    
    menu.onRollOver = function() {
    	_root.buttonSound.attachSound("RollOver");
    	_root.buttonSound.start();
    }
    The bolded if then statement seems to be not working correctly??

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Try (_root._currentframe == blah blah

    there are a lot of frames in the movie.. you need to specify which one else Flash will ignore it.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Unfortunately that is not it. It still for some reason doesn't recognize the first frame as the starting reference to play the movie when the initial index page is loaded?

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    What code do you have on the first frame?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That is the code on the first frame...

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Try double quotes:

    Code:
    if (_root._currentframe == 1 && addr == "") {
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #7
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nope, what is weird is I have another flash site that I got swfaddress working perfectly on and I have basically just emulated that flash file while only changing the number of frames between the address handling? The other site works perfect, playing the movie from the first frame while the user is on the index page.

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    WIthout seeing much, I can only guess at things... shouldn't you have a stop(); on frame one? There is a lot of info to parse there without a stop();
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    figures...

    Totally overlooked something that obvious and simple. Thanks.

  10. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Welcome
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •