PDA

View Full Version : play until a specific frame and stop...



vip3r
August 18th, 2002, 08:39 AM
how would i do this using actionscript?
i was kind of thinking like this:

onClipEvent(enterframe){
if(thecurrentframe=2){
stop();
}
}

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

lostinbeta
August 18th, 2002, 12:06 PM
Right click on the frame you want the movie to stop on, hit actions and just use stop()

vip3r
August 18th, 2002, 12:10 PM
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...

lostinbeta
August 18th, 2002, 12:17 PM
Well what about a gotoAndStop(frameNumber) action?

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

vip3r
August 18th, 2002, 12:46 PM
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....

iceman
August 18th, 2002, 01:00 PM
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:

on(release){
_root.animation.gotoAndPlay("start");
}
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


Kyle:)

vip3r
August 18th, 2002, 03:24 PM
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 http://www.vip3r.com/temp/navigator.fla
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 :)

iceman
August 18th, 2002, 04:04 PM
your fla is corrupted my machine wont' open the file..

Kle

vip3r
August 18th, 2002, 04:28 PM
i'll send u the file, wuts ur email?
if u don't feel like putting it on the forums, just email me:
snakedevil1@lycos.com
and i'll reply with the file
thanx!!

sbeener
August 18th, 2002, 09:56 PM
viper,

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


onClipEvent(enterframe){
if(_currentframe==2){
stop();
}
}

vip3r
August 19th, 2002, 09:35 PM
wow, thats pretty close :)
thanx for helping :)