A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] [AS2] gotoAndPlay not working

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    28

    resolved [RESOLVED] [AS2] gotoAndPlay not working

    After slowly going crazy, I have decided to post my problem here.

    It seems to go to the right frame, but it STOPS...
    There is no action script code in the frame it's sent to.


    Code:
    this.onEnterFrame = function() {
    	_root.maincontent_tb = _root.dbi_MC.mainContent_MC.getBytesTotal();
        _root.maincontent_tl = _root.dbi_MC.mainContent_MC.getBytesLoaded();
    	_root.maincontent_loaded = _root.maincontent_tl/_root.maincontent_tb;
    	
    	_root.maincontent_percent = Math.round(_root.maincontent_loaded * 100);
    	
    	if (_root.maincontent_percent == 100){
    		gotoAndPlay ("fadeout");
    		_root.dbi_MC.loadingScreen2_MC.gotoAndStop (5);
    		
    	} else {
    		gotoAndPlay ("recheck");
    	}
    	
    };
    The zipped fla can be found at:
    http://www.sunsigns.ca/newsite/sunsi...s/dbi_main.zip

    The movie/page at:
    http://www.sunsigns.ca/newsite/sunsi...mainpage.shtml

    the code I've posted is found in the Movie clip "sceneTransition" at frame 30.

    any comments/help is greatly appreciated.

    --

    I forgot to NOTE... if I tell the gotoAndPlay to go to say... frame 45. It will stop on that frame.
    And if I put a frame action on that frame that says "gotoAndPlay(46);"... it will go to frame 46 and stop. Ultra annoying... ;p
    Last edited by blackbeagle; 01-29-2008 at 05:27 PM.

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Posts
    28
    seems to be working after two things...
    A) Adding "delete this.onEnterFrame;" within the 'if' statement.
    B) FTP'ing the CORRECT file to the server (smack myself in the head)

    So my code is now more like:
    Code:
    if (_root.maincontent_percent == 100){
    		gotoAndPlay ("fadeout");
    		_root.dbi_MC.loadingScreen2_MC.gotoAndStop (5);
    		
    		delete this.onEnterFrame;  <---- this is the line I added
    		
    	} else {
    		gotoAndPlay ("recheck");
    	}
    	
    };

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center