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?
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!
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.