Skip to main content
Participant
June 15, 2009
Answered

Stopping a MovieClip on a Certain Frame

  • June 15, 2009
  • 1 reply
  • 762 views

I am doing an animation of a van and need the wheels to stop when the van stops.  The van is in a movieclip has a motion tween on it moving it left to right.  I tried putting the following on the timeline of the last frame (frame 72) in the movie clip but it doesn't work. The wheels keep spinning.

stop();

this.vanRight.rotatingTires.backWheel.Stop();

this.vanRight.rotatingTires.frontWheel.Stop();

Help is appreciated, and need it in ActionScript 2

Thanks!

This topic has been closed for replies.
Correct answer kglad

all your stop methods should be:

stop();

ie, case counts.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 15, 2009

all your stop methods should be:

stop();

ie, case counts.

jkrudeenAuthor
Participant
June 15, 2009

Thanks for that, amazing how I stared at that and never notice the uppercasing.  Flash didn't notify me of any syntax error either. 

Also, I had to change the relative path to absolute to correctly find the two wheel movie clips.

_root.vanRight.rotatingTires.backWheel.stop();

_root.vanRight.rotatingTires.frontWheel.stop();

Inspiring
June 15, 2009

Well using an absolute path will make this hard to work with in the future and is generally not the best way to go about things.

If the rotatingTires clip is on the same timeline as this code then it would probably be:

rotatingTires.backWheel.stop();

etc.

If you need to find out where you are in the heirarchy you could add a trace statement:

trace("The scope is: "+this);

That would let you see where you are in the list and know if you need to use things like _parent or just drill down further.