Search code examples
htmlcreatejs

Properly Stop a movieclip in Animate CC with HTML5


I am trying to stop a movieclip in the stage with an instance name and i cannot seemed to properly get it working.

I can call this.myMC.stop() on the second frame but it will still continue to play if the main stage starts to play. it will only work if i have only 2 frames in the stage.

I am publishing this in html5 canvas using animate CC


Solution

  • The reason you couldn't do it because the movieclip "myMC" has its own timeline and you need to put the stop script at the last frame of the movieclip "myMC" own timeline not the main timeline. Here is how you can do it.

    Double click on your "myMC" on stage to go into the timeline of "myMC" movieclip. For example if you have 10 frames for "myMC" movie clip, create a new layer, then insert a key frame on frame 10 and add this line to the newly created key frame:

    this.stop();