image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Design & Media

Reply
 
LinkBack Thread Tools
  #1  
Old February 20th, 2005, 02:46 PM
Perseus's Avatar
Registered User
 
Join Date: Mar 2003
Location: Brooklyn, NY
Posts: 446
Thanks: 0
Thanked 0 Times in 0 Posts
Perseus is on a distinguished road
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
Reply With Quote
  #2  
Old March 10th, 2005, 08:59 PM
Pixel Farmer
 
Join Date: Feb 2002
Location: MN
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
mweier is on a distinguished road
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);
}
obviously each button uses different number (or frame label, if you enclose in "s) for insertFramenumberhere so that it jumps to that piece of art.

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
Reply With Quote
  #3  
Old March 22nd, 2005, 04:42 PM
Natobasso's Avatar
Tech-Bot 5000
 
Join Date: Jul 2002
Location: Auckland, New Zealand
Posts: 3,270
Thanks: 1
Thanked 16 Times in 16 Posts
Natobasso is on a distinguished road
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
Reply With Quote
  #4  
Old March 23rd, 2005, 09:26 AM
Pixel Farmer
 
Join Date: Feb 2002
Location: MN
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
mweier is on a distinguished road
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
Reply With Quote
  #5  
Old March 23rd, 2005, 01:41 PM
Natobasso's Avatar
Tech-Bot 5000
 
Join Date: Jul 2002
Location: Auckland, New Zealand
Posts: 3,270
Thanks: 1
Thanked 16 Times in 16 Posts
Natobasso is on a distinguished road
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
Reply With Quote
  #6  
Old March 23rd, 2005, 07:22 PM
ElDiabloConCaca's Avatar
Registered User
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 12,672
Thanks: 7
Thanked 388 Times in 370 Posts
ElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of light
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
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 04:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.