Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Need Help With ActionScript in Flash 5

Need Help With ActionScript in Flash 5
Thread Tools
Professional Poster
Join Date: Feb 2000
Location: Nashville, TN
Status: Offline
Reply With Quote
Jul 25, 2001, 10:21 AM
 
I'm creating a Flash Application at MIT... I need to find out how to replace a button if another button is triggered.

THANKS!!!!

Don't try to outweird me, I get stranger things than you free with my breakfast cereal.
     
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Jul 25, 2001, 12:48 PM
 
Originally posted by DeathToWindows:
<STRONG>I'm creating a Flash Application at MIT... I need to find out how to replace a button if another button is triggered.

THANKS!!!!</STRONG>
Do you literally need to replace the button? I mean, could you accomplish the same by moving to a different frame when the other button is triggered? And have that frame have the new button in the same location? It'd be easy to "bounce" between the two frames when the button is clicked (just create endless loops for the two frames and jump between them via the button click - or is that Director? Does Flash have the "go to and stop" command that leaves buttons active? Can't remember right now). With some more scripting work, I think you could simply hide and move one button and move and unhide the "new" button to the same location (I think you need to move the button because buttons will still respond to clicks even when invisible).

If you need to actually replace the actual button, I think there's a (fairly complicated) way to do that as well using symbols and movie instances, but it may be overkill. Post again with more details if you need more help and we'll see if we can't do something for ya (a URL would be great).
     
Professional Poster
Join Date: Feb 2000
Location: Nashville, TN
Status: Offline
Reply With Quote
Jul 25, 2001, 01:44 PM
 
More detail on problem:

I'm creating a login-based Flash 5 Application that needs to be able to respond to a successful login by changing a "Login" button that is in almost every layer to a "My Filespace" button in response. Is there a way to have this happen?

Thanks.

Don't try to outweird me, I get stranger things than you free with my breakfast cereal.
     
Fresh-Faced Recruit
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jul 27, 2001, 05:37 PM
 
Make a movie clip for your buttons with your Login button on one frame and your My Filespace button in a second frame. This movie clip must be a symbol so create it using 'new symbol'. Make sure to add a 'stop' action to each frame of the clip (frame, not button).

Now, find your new movie clip in the Library pane. Drag it to the stage and position it where you want it. Select it and give it a name in the instance pane. It must have a name so you can address it using actionscript.

Once you've done that, you can use the 'telltarget' action on the button click. Add the telltarget action, enter the path of your movie clip, and then use a goto action to move the clip from frame 1 to frame 2, and vice versa for your second button. Refer to your 'Help' section for specifics on the telltarget action and specifying the path.

You can use the same movie clip and the same actions from any layer on the stage. If you want to extend the buttons across scenes and loaded movies, just make it a separate movie and load it to its own level.
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:36 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2