Real simple but cant figure it out.
Just trying out flash cs3 and I cant seem to get the main timeline to stop looping as the stop(); command will not work at all.
Does anyone know how to stop the timeline in CS3...its driving me potty.
I'm having the same problem with stop(). Stop() won't work in frame 1 (or any other frame for that matter) on the main timeline. Keep in mind that this only occurs when I'm playing my movie within Flash (Control Menu > Play). If I choose the Test Movie option, it works. But I should be able to play this within Flash too. Furthermore, I copied the same code into a new AS2 file and it works fine. So something is wrong with AS3 or it requires additional code. I have nothing else in my file besides stop() so it's not conflicting with anything. The layer is visible too. Any ideas? Thanks!
The CONTROL->PLAY feature (same as pressing ENTER) in Flash does not run any actionscript. The sole purpose is to move the playhead. It is the same in AS2, so the real question here is "How are you getting it to stop in AS2 by using the CONTROL->PLAY feature?"
wessidemd, if you go to Control, check "enable simple frame actions", and then Control > Play, it will acknowledge the stop() in AS2 (and I assume other actionscript as well). I haven't used Flash CS3 much but I remember this working back in Flash 5 as well. I have more experience using Director where it's common practice to test on the timeline like this. I don't know why this feature would be removed in Flash CS3.
Very interesting, I've never even considered testing my movie on the timeline. I've only used it to see where a particular tween would be at a particular time. I do know that playing the movie that way consumes a ridiculous amount of CPU resources.
I guess I'm not the person to ask in this case. Sorry I couldn't help.
I was able to duplicate this issue with a nested MovieClip with just 2 frames. Both frames have a stop();.
If I were to drag the MC manually onto the stage, the stop(); method would work and stop at the first frame. However if I were to add to the stage dynamically with addChild(), it won't.
When tracing in the frames, I found that the first frame has been skipped , none of the trace from the first frame showed up and went straight to the second. I solved it by adding an extra frame before the first stop();, it works and tracing shows that I'm on the first stopped frame.
Now, the question here is, why does this happen?
P.S.:
I've made a simple Test.fla to show how the issue can be reproduced.
Basically, there's a button to add the container from the library. Container has a nested movieclip with 2 frames, a stop(); on each. I've placed one of the Container onto the stage and when the button is clicked, it'll add Container (again) and Container2 onto the stage as well. All for comparison purposes only. I duplicated a Container2 with a MovieClipwith 3 frames, but stop(); on the last 2 only to show what I was talking about as a solution(?).
Code:
button.buttonMode = true;
button.addEventListener(MouseEvent.CLICK, clickListener);
function clickListener(e:MouseEvent)
{
var container:Container = new Container();
container.x = 150;
container.y = 150;
addChild(container);
var container2:Container2 = new Container2();
container2.x = 150;
container2.y = container.y + container.height + 20;
addChild(container2);
}
Thanks for looking into that issue, haplodotx. Your example also gave me a better understanding of how to pull items in from the library which I've been struggling to grasp, so I appreciate the test file as well. Thanks!
I am making animations in Flash CS3. I do not know how to use Actionscript yet but I want to stop my animations so they do not loop in the swf files. I have added stop(); to a keyframe at the end of my timeline. Sometimes it works but most often it does not. Have tried this over and over again. What am I doing wrong? I am really tired of looking at the whole animation in test movie just to see if it is going to repeat.
The person named "Mazoonist" provided an example which worked and didn't loop. But he put his movie clip animation inside another movie clip on the main timeline. So perhaps in order for this to work, you must create your animation inside another movie clip rather than directly on the main timeline.