Disable on click

my main page has 5 buttons. when it loads, it has nothing. the user should should from the buttons where he wants to go: about, pictures, graphics, webdesign,contact.

i want to disable each button in its own page. for example, when clicked on “about”, the about SWF loads but i want the “about” button to be disabled in his page.

same for the rest. i have some mouseover captions also.

i tried the code posted by electrongeek but it didnt work at all.

this is the code on each button:

on (release) {
_root.contents.loadMovie(“about.swf”); //or pictures.swf, … etc
}
on (rollOver) {
_root.x = 1;
_root.caption.words = “About me”;
}
on (rollOut) {
_root.x = 0;
_root.caption.words = " ";
}

//all button code
Button_Names = ['about', 'portfolio', 'extras', 'audio', 'client', 'email', 'phone', 'privacy', 'credits', 'as'];
for (i=0; i<=Button_Names.length-1; i++) {
        item = Button_Names*;
        this[item+"_btn"].mov = item;s
        this[item+"_btn"].onRelease = function() {
                //trace('release: load movie: '+this.mov+'.swf');
                loadMovieNum(this.mov+".swf", 2);
                this.gotoAndStop("_disabled");
                this.enabled = 0;
                Enable_Buttons(this.mov);
        };
        this[item+"_btn"].onRollOver = function() {
                //trace("over: " + this.mov);
                this[item+"_btn"].gotoAndPlay("_over");
        };
        this[item+"_btn"].onRollOut = function() {
                //trace(this.mov+ " is now >> UP");
                this[item+"_btn"].gotoAndPlay("_up");
        };
        this[item+"_btn"].onPress = function() {
                //trace("press: " + this.mov);
                this[item+"_btn"].gotoAndPlay("_down");
        };
}
function Enable_Buttons(selected) {
        for (i=0; i<=Button_Names.length-1; i++) {
                if (Button_Names* != selected) {
                        this[Button_Names*+"_btn"].gotoAndStop("_up");
                        this[Button_Names*+"_btn"].enabled=1;
                }
        }
}
Button.prototype.useHandCursor = false
//end button code

this code loads a swf for each content area and disables the selected button and then enables all other buttons, just change the button names. this works very well

it didnt do anything.
should i add it to my previous code ?? or what ??

You should use Button.enabled for this, and set it to false when you press a button. But if you want it to work, you’ll have to use dynamic even handlers like Subquark did (in order to be able to do this.enabled=0;

pom :slight_smile:

Basically

yourButton.onRelease=function() {
  _root.contents.loadMovie("about.swf"); //or pictures.swf, ... etc
  this.enabled=0;
}

You might also need to reactivate the other buttons at that point.

got it man, thx

hi elietabet, wish i could take the credit for the code i posted, but i am nowhere near that good. it was developed with the BIG help of certain gracious members of this forum. for a better explanation, you can go to my site and click the “subquark actionscript” button in the lower left hand corner. i put most of the code there and a screenshot of my basic button (an mc) structure - good luck

i hope to one day have a hundredth of the actionscript skill of ilyaslamasse (really, no bs) :slight_smile: