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!

Linked Buttons

Status
Not open for further replies.
May 22, 2002
63
GB
Hi,

I have a flash movie with 4 independant buttons in. Each one changes state to an 'on' state when clicked, but I would like to configure it so that only one can be on at a time. At the moment they can all be clicked and turned on. Ideally when one is 'on' and another is clicked, I would like the one which is on to turn off, and the new button go to its 'on' state.

If anyone wants to see the SWF file i can email it.

Many thanks for any help,

Anders
 
I think the best thing to do here is:

Create four movie clips and give them instance names of

* one
* two
* three
* four

Have these movie clips look like your on and off states e.g. have 2 keyframes; frame 1 is off, frame 2 is on. Have stop actions on each of these frames.

Create a button which is the same shape as the movie clips. It doesn't matter about the content in it because its going to be invisible.

Drag four copies of it onto the stage (one over each movie clip). Set the button's alpha to 0%.

Put the following actions on each button:

on (release) {
tellTarget (_root.one) {
gotoAndStop (2);
}
tellTarget (_root.two) {
gotoAndStop (1);
}
tellTarget (_root.three) {
gotoAndStop (1);
}
tellTarget (_root.four) {
gotoAndStop (1);
}
}


Obviously change the actions to suit each button e.g. the above action would go on button 1.

This should get you started. If you want anymore help, let me know and I'll try.

Regards
 
Hi again,

It doesn't seem to do anything now? Clicking on the button doesnt make anything change state now.

Shall I email you the SWF? its about 30k?

Anders
 
Email the fla...preferrably zipped up.

Address is thatrenowned@hotmail.com

I'll take a look at it tomorrow and mail you back.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top