I have 4 buttons on a page. If i pressed on a button another movie will load, over my “index -movie”, but i will see my index movie on the background. That works, but the buttons of my index movie are also actif, so i will disable the buttons. I have try out button.enable=false; But he won’t…
try button.enabled = false;
?
Also its better to use mc’s as buttons generally.
*Originally posted by sweepah *
**Also its better to use mc’s as buttons generally. **
bah! is that written somewhere? I want to know where people are getting that idea
to make it easier, you can give the movieclip the buttons are in a null on action and enabled = false on that thereby disabling all the buttons within without having to do each one individually.
here is a prototype that will do just that
MovieClip.prototype.disableAllButtons = function(act) {
if (this.enabled = !act){ if (!this.onPress) delete this.onPress;
}else if (!this.onPress) this.onPress = null;
}
where act is true or false depending on whether or not to disable all the buttons in the movieclip or not
because they can do everything a button can and more?
I think you have one too many ! in your code.
if(this.onPress) delete this.onPress;
they lack the basic the BASIC functionality of a button which is ROLLOVER STATES and their advantage comes in the ability to easily set them using the button symbol. For movieclips it would have to be programmed in. Besides, in MX buttons can do just about everything movieclips can. :-\
and the code does more than just
if(this.onPress) delete this.onPress;
so it needs those nots
You’re right i misread your brackets,sorry
Anyway as someone who up till now preferred ac over design it has been easier not making the distinction between buttons and movieclips. I do understand however that some people would prefer their ease of use.
yeah its mostly preference, though for button buttons usually buttons are ‘best’. For interactivity with interactive/animated elements, movieclips are usually ‘best’. It depends on circumstance.
lemme see if I can dig up that post before about them…
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=18505
mostly on the second page. Basically me spouting off the same stuff here