PDA

View Full Version : button script twice on release



raq35
09-01-2004, 10:23 AM
hi i'm stock maybe u can help me with a script, i can't figure out alone.
OK
it's for a series of buttons - when roll over a image is visible, when click a image is visible and stays visible, when click again no visible


:?

NTD
09-01-2004, 03:39 PM
Hi,

Here is how you can toggle visibility from a button........

set a variable to toggle visibility with...


myVisible = false;


control the visibility of a named clip...


mcName.onEnterFrame=function() {
if(myVisible) {
this._visibility=true;
}else{
this._visibility=false;
}
}

then call it from a single button like this...


on (release) {
if(myVisible) {
myVisible=false;
}else{
myVisible=true;
}
}


You can also toggle the visible property with a rollOver action, but this might cause issues in using both a release and rollOver action to control the same property.

Hope it helps
NTD