hi,
how can i call all buttons within a certain movieclip (without naming each instance individually)?
Im looking for the actionscript.
Thanks!
hi,
how can i call all buttons within a certain movieclip (without naming each instance individually)?
Im looking for the actionscript.
Thanks!
for loop
with each button called but1, but2 etc
standard
for(var i in myMovieClip) {
var thisMovie:Object = myMovieClip*;
if (typeOf(thisMovie) === "movieclip") {
trace(thisMovie);
}
}
this is great, I’ve had this doubt before and this aims at it.
there’s something else I’d like to ask, though. I know it might sound kinda stupid, but what the heck.
suppose you’ve got several buttons in a movieclip, each one with its set of instructions, whatever. (I’m going for buttons, but I think this could apply for any sort of object, really)
each button’s got a prefix of some sort and then its specific name, say ‘buttonHere_btn’, ‘buttonThere_btn’, ‘buttonEverywhere_btn’.
all I want is to change the specific bit in each buttons’ designation…
could this be done with an array holding the specific names for each button, that is [“Here”, “There”, “Everywhere”] and then loop across this array? how do I name each button then? I’m looking for the syntax, 'cause I’ve been trying this and it always messes up…
thanks!
that is possible but incrementing with numbers is the standard
for example xml
this.firstchild.ChildNodes[0] = title 0 = "here"
this.firstchild.ChildNodes[1] = title 1 = "there"
etc
also you should use movieclips as buttons,
:: Copyright KIRUPA 2024 //--