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

flash actionscript : Need buttons to remain highlighted when I click on them


Flock
10/20/2005 8:10:24 PM
I need to have a button in the down state when it?s corresponding SWF file is loaded, and have all other buttons remain in the up state.
brenton(asi)
10/20/2005 8:27:32 PM
albee
10/20/2005 9:39:10 PM
You could make your buttons from movieclips with three frames which must be
named "_up", "_over" and "_down". Each frame would show the state of the button
that corresponds to the frame. Then, here is how you would code your movieclips:

// define a variable that can hold a reference to the currently clicked button
var currentlyClicked;
// add button action code
firstBtn_mc.onRelease = function() {
currentlyClicked.enabled = true;
currentlyClicked.gotoAndStop("_up");
this.enabled = false;
this.gotoAndStop("_down");
currentlyClicked = this;
// add you swf enabling code here...
};
// keep adding the same code for all of your buttons
secondBtn_mc.onRelease = function() { ... };
// etc., etc., etc.

Hope this helps,

Albee

Flock
10/20/2005 10:49:38 PM
albee
10/21/2005 12:00:00 AM
WickedSense
10/21/2005 5:56:14 AM
AddThis Social Bookmark Button