Copy link to clipboard
Copied
Ok, I've seen this posted several times but all not quite what I'm asking. I have just created a new project and wanted to just test the most basic commands. I have a script in an Actions layer that says "stop();" without the quotes obviously. It doesn't stop the playhead. It stops it at the end but not at frame 2 where the script is.
I just asked on Chat and was sent here because it was "code related!".
I've seen comments about this.stop() but this is not HTML canvas. I'm publishing as AIR for desktop at the moment to test and it does stop at the right place in published file, just not when I hit Enter in Animate itself.
Any ideas?
You say it happens when you hit Enter... and you see the playhead moving along the timeline. That is just going to play thru the timeline, it is not processing code when you do that. Try hitting CTRL-Enter instead. That will publish/play the output file and should stop at the frame intended.
Copy link to clipboard
Copied
Is there any other code in the file?
Copy link to clipboard
Copied
No, literally just that line in a layer called Actions (it labelled it that automatically).
Copy link to clipboard
Copied
What else is in the file that makes you say it reaches the end before it stops?
The stop() command is a timeline command, so if you were to have a movieclip in the same frame as the stop command in the main timeline, the main timeline would stop at that frame, but the movieclip would play itself out. If the intent was to stop the movieclip then your command would either have to be inside the movieclip or the code in the main timeline would have to target the movieclip by its instance name with a stop() command [ eg: mcName.stop(); ]
Copy link to clipboard
Copied
I have 2 images in the timeline. The second image starts at frame 5. The AS stop(); is in frame 4. When I Debug, it plays by showing the first, then the second image and loops, switching back and forth. When I play in Animate the play head just plays along to the end of the timeline. It never stops.
Copy link to clipboard
Copied
You say it happens when you hit Enter... and you see the playhead moving along the timeline. That is just going to play thru the timeline, it is not processing code when you do that. Try hitting CTRL-Enter instead. That will publish/play the output file and should stop at the frame intended.
Copy link to clipboard
Copied
Ok, that's useful to know thank you. It was also doing the same thing in Debug playback (Shift CTRL Enter). I have however "fixed" that issue through a change that should have made no difference - I swapped the two images around so image2 appears first. There is no other code in the project so this seems completely nonsensical to me. I think there's a bug floating around...
Copy link to clipboard
Copied
If you are seeing the timeline playhead moving you are looking at the wrong animal.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now