Copy link to clipboard
Copied
I was just testing the program, and I created a simple motion animation, and added a stop on the timeline and it simply does not work. Not with a motion tween, not with a classic tween.
There are no errors on the output. I also checked the browser console, and tested in multiple browsers. I am using an mc (movie clip symbol).
All by the book. I never had these issues with Flash.
This is a simple thing, and I have no idea what is going on.
If you are using HTML5 Canvas must add this before stop.
this.stop();
Copy link to clipboard
Copied
If you are using HTML5 Canvas must add this before stop.
this.stop();
Copy link to clipboard
Copied
I have found the same issue. I am not using HTML Canvas. Either way, I tried both stop(); and this.stop(); in the Actions layer on the timeline and neither work. When hitting Enter in Animate it ignores it. When Debug it ignores it. When Publish to AIR it ignores it.
I have created various new projects to try different settings, even tried on PC and Mac. Never works.
Copy link to clipboard
Copied
If you have a movieclip on the stage, a stop(); in the timeline won't stop the animation in the movieclip. You would either need to put a stop(); into the movieclip itself, or give the instance a name, then say, for example: myclip.stop();
Pressing the Enter key when looking at the timeline only makes the playback head move along, it doesn't trigger any of the scripts.
If you do a Debug, or Test Movie, or test AIR in the debug player, look for any errors in the Compiler window or the Output panel.
Copy link to clipboard
Copied
Hello,
I'm having trouble getting stop(); to work for me. I've got a movie clip with it's own animation placed on an outer timeline, with an instance name mc_lettermark1. Per adobe's tooltips, I make a new layer, open the actions panel, select the movie clip on the artboard, and click on the "Stop a movie clip" snippet in the code snippets panel. It prints out the following:
/* Stop a Movie Clip
Stops the specified movie clip on stage.
Instructions:
1. Use this code for movie clips that are currently playing.
*/
this.mc_lettermark1.stop();
I don't know if it makes a difference, but I have the action in a frame towards the end of the timeline. When I preview in browser, the movie clip keeps on looping like nothing's happened. The Chrome console has the following error message:
300x250%20test.2.js: 470 Uncaught TypeError: Cannot read property 'stop' of undefined
at lib._300x250test2.frame_60 (300x250%20test.2.js:470)
at a.b._runActions (createjs-2015.11.26.min.js:17)
at a.b.setPosition (createjs-2015.11.26.min.js:17)
at a.b.setPosition (createjs-2015.11.26.min.js:17)
at lib._300x250test2.c._updateTimeline (createjs-2015.11.26.min.js:14)
at lib._300x250test2.c.advance (createjs-2015.11.26.min.js:14)
at lib._300x250test2.c._tick (createjs-2015.11.26.min.js:14)
at lib.Stage.b._tick (createjs-2015.11.26.min.js:13)
at lib.Stage.b.tick (createjs-2015.11.26.min.js:13)
at lib.Stage.b.update (createjs-2015.11.26.min.js:13)
Any advice for how to fix this? I don't really know javascript, but it sounds like it can't find the instance name. This seems pretty basic, am I missing something?
Thanks,
Grayson
Copy link to clipboard
Copied
If there are any keyframes in that movie clip's timeline, make sure that it still has a name of mc_lettermark1. If it changes name after a keyframe then it won't be found.
Copy link to clipboard
Copied
Wow, this is really strange. So I've got a bunch of keyframes defining all the animation and stuff, and the instance name of the movie clip doesn't show up until the very last keyframe. (This is on the outer timeline.) Why is that? Do I need to give it a name on every single keyframe?
Copy link to clipboard
Copied
You do now. The normal way to work is to give it a name before you start adding keyframes, then it will keep the name.
ActionScript is smart enough to take the latest name of the movieclip, but in Canvas it takes the first name you used. You might get away with just naming the first one in the timeline, but I would name them all, and remember to name them before doing keyframes next time.
Copy link to clipboard
Copied
BTW, make sure you're selecting the movieclip on the stage to see its name. Selecting the keyframe in the timeline won't show the instance name.
Copy link to clipboard
Copied
Thank you, I'm not sure what I did but the error seems to have resolved itself. I'll keep your notes in mind in future projects.
Copy link to clipboard
Copied
I tried using stop(); then this.stop(); - neither of which worked! Can someone from Adobe clarify why?
Copy link to clipboard
Copied
If you are doing HTML5 Canvas, stop(); is likely to cause an error, and so the this.stop(); won't be reached. Use the browser developer tools to look at the error console, to see what errors are happening.
Copy link to clipboard
Copied
It's working for me. Thanks
Copy link to clipboard
Copied
What's working for you?
Copy link to clipboard
Copied
this.stop(); function is working for me. Before I tried by stop(); function.
Copy link to clipboard
Copied
Okay... so you bumped a year-old thread to inform everyone that you're not having a problem with a common task?
Copy link to clipboard
Copied
This is a very old problem from flash and still is in the newest version.
Solution: Besides using this.stop(); in HTML5, never use blank key frames on the layer of the movieclip you want to target. Blank keyframes confuses flash/animate and make the movieclip unreliable...
Copy link to clipboard
Copied
Jaapnauta wrote
Solution: Besides using this.stop(); in HTML5, never use blank key frames on the layer of the movieclip you want to target. Blank keyframes confuses flash/animate and make the movieclip unreliable...
No, blank keyframes do not confuse Animate. What Animate does (wrong) in Canvas mode is very simple: The first instance of a particular library symbol on a layer will, when published, become the instance name for all instances of that symbol on that layer. This happens because they're literally all the same instance, just getting turned on and off as needed. Whoever wrote the Canvas exporter probably thought they were being tremendously clever.
Copy link to clipboard
Copied
Anyway, to avoid problems with executing scripts on timelines it stays wise not to use blank keyframes, really. Another tip is to not use different instance names on the same movieclip in different frames on the same layer... How flash deals with it by generating the output has never been the strongest reliable part of the software. And I have no idea why the responsible dude thinks he did something clever. This problem is known since the beginning of this millennium...