Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Mouse Over 1

Status
Not open for further replies.

Ablecken

Programmer
Jun 5, 2001
130
US
Say I wanted to have a button on my flash. I want that button to go 12 frames ahead and play then stop. Then when the user presses again it goes 12 more and stops. How would I do this?

Thanx a lot guys :)
 
Should the button be visible while it's playing, or just on the stop frames, to allow you to continue? BTW, what's playing?
mywink.gif
ldnewbie
 
it could be visible or not visible i dont really care. its kind of like a slide show that is playing.
 
If it some kind of slide show, pictures right? It doesn't even have to play more than 1 frame at a time really!
Scenario:
Show 10 pictures - Go from one to the next by pressing a button.

Hit New under File. Rename the layer "actions". Press F6 10 times. Double-click each of those frames and insert a stop(); action in each one of them. Insert a new layer. Rename it "pictures". Select the first frame and press F6 10 times again. Select the first frame, and import your first picture. Position it. Do the same for the nine other pictures, selecting the right frame and importing the picture. Next create your button. Under Insert, hit New Symbol. Name it "myfirstbutton" or whatever, and give it a button's behavior. Now draw a rectangle or whatever and put text over it like "NEXT", seems appropriate... When done with that drawing, press F6 twice. You should now have the same drawing under the "up", "over", "down" states. Leave the hit state empty. Under Edit, hit Edit Movie (or CTRL E) or hit the clapper icon (top right) and select scene 1. Once again insert another layer and name it "button". Press F5 this time 10 times or until the layers are all equal. Press CTRL L. This will open the Library. You Should see your button in there. Select the first frame of your button layer. From the library, select and drag your button on stage and position it... Lower right or wherever! Now right click on the button and select actions. Add an on action. You'll see something like this appear:

on(release){
}

Highlite the first line and add a goto action. You will now see:

on(release){
gotoAndPlay(1);
}

In the type box select Next Frame, you will now have:

on(release){
nextFrame();
}

You're done! Happy?
Under control hit Test Movie!


Finally, print this post so you can follow up while doing it!


mywink.gif
ldnewbie
 
Yeah but I would like to do a kind of leading animation between slides. like having the slide to off to the left while the next one comes from the right. ive alread done that part.
 
Now you say it!
Get in line!
Will have to come back to you later!
You might have an answer only by morning, unless somebody else picks this up!
mywink.gif
ldnewbie
 
Well add an "actions" layer. Add a keyframe(F6) at frame 12, 24, 36 and so forth. Insert a stop(); action in each one of those keyframes. Designed your "next" (or whatever!) button as described above, add a button layer, drag your button on stage and position it. Then after right-clicking the button insert this actionscript:

on(release){
play();
}

Movie will play and stop on the first keyframe that has a stop action. Pressing the button, will have the movie play till it encounters the next stop action... and so forth! If you don't have a stop on the last frame (after your last move out or something) the movie should restart from the beginning that is probably moving in your first image.
mywink.gif
ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top