Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : need help with script



dan mode ->Adobe Community Expert
10/30/2006 3:42:23 PM
You could always disable the button:

btnHome_mc.onRelease = function () {
this.enabled=false;
}

--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog



[quoted text, click to view]

spectre_fish
10/30/2006 10:17:02 PM

I'm very new to flash and I'm slowly building a website. I have some buttons
created and want a certain function to stop when another one is initiated. Here
is the actionscript:

btnHome_mc.onRollOver = function () {
btnHome_mc.gotoAndPlay("_rollover");
}
btnHome_mc.onRollOut = function () {
btnHome_mc.gotoAndPlay("_rollout");
}
btnHome_mc.onRelease = function () {
btnHome_mc.gotoAndPlay("_click"); gotoAndStop("home");
}

I want the onRollOut function to stop once the onRelease function is
initiated. Can anyone help?
dan mode ->Adobe Community Expert
10/31/2006 1:23:34 PM
So, basically...clicking on a button would disable itself but enable the
others?

btnHome_mc.onRelease = function () {
this.enabled=false;
btnOther.enabled=true;
btnOther2.enabled=true;
}

btnOther.onRelease = function () {
this.enabled=false;
btnHome_mc.enabled=true;
btnOther2.enabled=true;
}

btnOther2.onRelease = function () {
this.enabled=false;
btnHome_mc.enabled=true;
btnOther.enabled=true;
}


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog


[quoted text, click to view]

spectre_fish
10/31/2006 5:04:55 PM
That works perfectly THANKS!

However it does present me with another issue, I have 4 buttons that take me
to a different page of my site. If I use the "this.enabled=false" script for
each button, I get the effect I'm looking for with the press of the button, but
I want that effect to switch back to the original onRollOut event when any of
the other 3 buttons are pressed. Can you help out once again?

I sincerely appreciate it!!!
spectre_fish
10/31/2006 10:08:14 PM
That is very, very close to what I want. The only difference is I want the
onRollOut event for just the button that is disabled to automatically play
when the button is enabled again.

example: I press the "home" button and it gets disabled and enables the rest
of the buttons.
Then I press the "contact" button and it gets disabled and
enables the rest of the buttons AND plays the onRollOut function for the "home"
button that was disabled.

In other words, whichever button that is disabled has it's onRollOut event
play once it's re-enabled.

Hope that is clear enough.

Thank you very much!
spectre_fish
11/1/2006 10:47:40 PM
AddThis Social Bookmark Button