buttons/checkbox with on & off state


#1

I’m trying to create a flash location finder for my company. I’ve done the building in max & vecta. For the different rooms I want to turn them on and off using buttons or check boxes. I’ve already managed to control the alpha of each individual movie clip but now I’m stuck as how to change the alpha of one room then leave it like that untill the check box is unchecked again.

here’s an image of what I’m talking about.

Any help will be greatly appreciated

http://www.derekwebster.co.uk/upload/ultrashock_btns.gif


#2

i’d create true and false values for the check and unchecked states of your buttons then have a function onEnterFrame something like

if (mailroom == true) {
   _root._alpha = 100;
}

my syntax is a bit off but that’s the idea…

chris


#3

Thanks for the reply, sounds good. I’ll give it a go but I’m an action sctipt newbie.

Thanks for you help


#4

on (release)
{
var targ = this.radioButton.checked;
// the left side is just stating that the result will be the _visible state of targ (our checkbox)
// (targ._visible ? false : true);
//the targ._visible in the brackets is asking if targ._visible == true (just a code shorthand)
//? false : true… if its true set to false, if its false set to true
targ._visible = (targ._visible ? false : true);
}

this will swap between on and off with each click. you then just need to evaluate if _visible is true or false and it will tell you if its clicked or not


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.