Play until a specific frame and stop

how would i do this using actionscript?
i was kind of thinking like this:


but im not completely sure. what variable would the currentframe part be in??

Right click on the frame you want the movie to stop on, hit actions and just use stop()

well, the frame i want it to stop at will change depending on what the user clicks on… so i think i would have to use actionscript, right? since the conditional statement is actionscript, u would have to use actionscript to test the variable…

Well what about a gotoAndStop(frameNumber) action?

What are you trying to do, knowing that might help with the solution.

does go to and stop play through the until the stop number? i thought it just jumped to the specified frame…

when a user clicks a button,i want the animation to play and then stop at a specified frame…

i think the script i noted above will work once i figure out how to tell the frame is currnetly on…

What you need to do is create a movieclip that has the animation that you want in it and then place a stop action on the first frame of that movieclip. Then label the frame that you want the animation to start at and put a stop action and the frame that you want the animation to stop at. You can then just attach some code to your button like:

that should solve your problem and remember to give an instance name, this should through your animation rather then just going to a specific frame. You could also just make the animation on the main timeline and do the same procedure, it will work the same way.

Hope this helps


thanx a lot, but when the user clicks another button, i want it to stop at another place. u can download my flash file thingy at
and then u can c what im talking about…
up there where the selctor layer is, i want the selector object to move to cover the button clicked on…
thanx again :slight_smile:

your fla is corrupted my machine wont’ open the file…


i’ll send u the file, wuts ur email?
if u don’t feel like putting it on the forums, just email me:
[email protected]
and i’ll reply with the file


your original code is only a few characters away from working:


wow, thats pretty close :slight_smile:
thanx for helping :slight_smile: