Groups | Blog | Home
all groups > flash (macromedia) > january 2004 >

flash (macromedia) : button states


tony
1/21/2004 10:23:46 PM
hi all,

i'm working on a project where i have a row of buttons and each of them
opens a video clip. these buttons have "on" and "off" states. i would like
it so when the user selects a button it stays selected and is showing it's
"on" state until they select another button in which case i would want it to
go back to it's "off" state. does this make sense? if anyone has any
suggestions about doing this it would be great.

thanks! t

tony
1/22/2004 12:03:32 AM
wow! works perfect. and so simple too. thanks so much urami! you saved me
hours of headache : )

t


[quoted text, click to view]

urami_
1/22/2004 12:09:10 PM

[quoted text, click to view]


We could make movie clip with two frames , frame 1 button and frame 2 pressed button.
On press send the movie clip to second frame . Than using "for loop" we can reset all
the buttons expect the one currently pressed .
We could as well use movie clips directly and assign buttons events to it .
Make a movie clip with two frames , frame 1 UP state and frame 2 DOWN (pressed) state and movie clip
that loops.

Give the movie clip instance name (right click the movie clip - properties , type instance name)
Call them Mc1 Mc2 Mc3 Mc4....
Than we would add something like that to timeline frame :


//for button mc1
mc1.onRelease = function() {
for (i=1; i<=4; i++) {
_root["mc"+i].gotoAndStop(1)
} mc1.gotoAndStop(2)
};

//for button mc2
mc2.onRelease = function() {
for (i=1; i<=4; i++) {
_root["mc"+i].gotoAndStop(1)
} mc2.gotoAndStop(2)
};

and so on.....
it will reset all the movies and than current send to frame 2 .
sample made on above description :
http://www.flashfugitive.com/button_down.swf







Regards


urami_*

<xmas>
http://flashfugitive.com/
AddThis Social Bookmark Button