bham3dman
asked on
What is different in actionscript 3 with regard to the stop() action?
Greetings Experts,
I am having difficulty preventing Flash scenes from looping in AS3. I have a very simple test file with two scenes (Scene 1 and Scene 2). I have a button in Scene 1 that when clicked, loads Scene 2. This works correctly in AS2 but in AS3 the two scenes just continuously loop. AS3 seems to be ignoring my stop() action (or I am doing something wrong).
Scene 1 frame 1 actions:
btnSubmit.onRelease = function() {
gotoAndPlay("Scene 2", 1);
}
Scene 1 frame 2 actions:
stop();
Scene 2 frame 1 actions:
stop();
Can someone please help me understand what I'm doing wrong? Please elaborate on the "why" behind your solution.
Thanks!
I am having difficulty preventing Flash scenes from looping in AS3. I have a very simple test file with two scenes (Scene 1 and Scene 2). I have a button in Scene 1 that when clicked, loads Scene 2. This works correctly in AS2 but in AS3 the two scenes just continuously loop. AS3 seems to be ignoring my stop() action (or I am doing something wrong).
Scene 1 frame 1 actions:
btnSubmit.onRelease = function() {
gotoAndPlay("Scene 2", 1);
}
Scene 1 frame 2 actions:
stop();
Scene 2 frame 1 actions:
stop();
Can someone please help me understand what I'm doing wrong? Please elaborate on the "why" behind your solution.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The following code worked:
btnSubmit.addEventListener
function btnSubmit_CLICK (event:MouseEvent):void
{
gotoAndPlay(1, "Scene 2");
}
stop();
Thanks!