|
#1
| ||||
| ||||
| Flash stop action in buttons
OK, I am sort of creating a gallery, and using buttons so people can see my work. When they click on "1" the first piece will show up. I want it to stay there, until the user clicks on 2, 3, or whatever. For some reason, Flash is not allowing Stop actions on the down or hit state. How would I go about executing what I want?
__________________ PowerMac G4 | Dual 500 MHz | 640 RAM | OS 10.4.6 | CD-R/DVD-R | 64 VRAM PowerBook 100 | 4 RAM | OS 7.2 |
|
#2
| |||
| |||
|
frame actions don't work *in* buttons. object actions can be assigned *on* buttons (by selecting button on stage). this is where you'd put your button event handler. simplest solution is to have a layer for art. place a keyframe for each piece. have another layer for buttons. just one keyframe on that layer with duration as long as your art keys do. then on each button, something like this: Code: on (release){
gotoAndStop(insertFramenumberhere);
}
finally, be sure you have a stop(); frame action on frame 1 of the timeline (i typically have an actions layer for that). Otherwise your movie will loop through all art nonstop. tons of more complex/tricky/elegant ways to do this, but this should get you started.
__________________ Dual 2Ghz G5 | 2.5GB RAM | 23" Studio Display (OSX 10.4.x), 12.1" iBook 600Mhz G3 (OSX 10.4.x), Athlon 2800+XP (WinXP w/ LCD TV), Athlon 2000+XP Shuttle PC (WinXP/MAME), Pentium III 700Mhz (Win2K/MAME), iPod Video 80GB, iPod Nano 4GB, Commodore 64 check out my art & animation |
|
#3
| ||||
| ||||
|
Instead of each button being a "stop" action, why not have each button be a "go" action. Meaning each button takes you to a new frame/image. Though the previous post isn't wrong in the slightest…just wanted to bring up a different way of thinking.
__________________ http://thesalon.blogspot.com |
|
#4
| |||
| |||
|
Natobasso: your different way of thinking is actually the same thing as what I said. "gotoAndStop" is the actionScript command for having the playback head "go" to a frame. However, since you don't want it to get to that image & then scrub through every other image in sequence (since they're hanging out on the subsequent frames), it's "gotoAndStop" so that it stops once it gets there.
__________________ Dual 2Ghz G5 | 2.5GB RAM | 23" Studio Display (OSX 10.4.x), 12.1" iBook 600Mhz G3 (OSX 10.4.x), Athlon 2800+XP (WinXP w/ LCD TV), Athlon 2000+XP Shuttle PC (WinXP/MAME), Pentium III 700Mhz (Win2K/MAME), iPod Video 80GB, iPod Nano 4GB, Commodore 64 check out my art & animation |
|
#5
| ||||
| ||||
|
I do understand what you're trying to do. Maybe if you thought of each picture frame as a separate "scene" in flash, then you wouldn't have to worry about it flowing and not stopping? You'd HAVE to click the forward or back button to make it move. Maybe not the most elegant solution… ![]() Then each button's action would only be a "goto" action instead of a goto and stop action. Otherwise, maybe you're producing a flash animation that has actions turned off; and that's why it's not working?
__________________ http://thesalon.blogspot.com |
|
#6
| ||||
| ||||
|
Unless a "stop" action is placed at the end of a scene, the movie will continue to play through, seamlessly, to the next scene. Just make note of the last frame of your animation, then do what mwweier said with the snippet of code. There are a number of different ways to accomplish this, depending on what you want to do. Do you want transition effects, or will there be animation? You can use a "gotoAndPlay" bit of code for these, with a "stop" action on the last frame of the animation. If they're just static images on different frames, then you can scrap the "stop" action for the frames and just use a "gotoAndStop" bit of code.
__________________ Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb http://www.jeffhoppe.com |
![]() |
| Bookmarks |
| Thread Tools | |
|
|