Originally posted by geoffp08 I dont know, youd have to ask him?
<whispers> I think its because he has 25 buttons in need of a dynamic solution ... shhh...
if i wanted to make 25 buttons (along with the movie) disappear i could.
i just want the button that has been clicked to disappear.
if you use the array i provided earlier to define all your buttons (by instance name) you can call just a few lines of actionscript in the beginning of your movie to define that function for all buttons...
Originally posted by geoffp08 if you use the array i provided earlier to define all your buttons (by instance name) you can call just a few lines of actionscript in the beginning of your movie to define that function for all buttons...
i did try that...
Code:
var myButtons = new Array();
myButtons[0] = "button1";
myButtons[1] = "button2";
myButtons[2] = "button3";
...etc...
then on the button i had a function being called which is needed for other things as well...
Code:
on (release) {
theFunction(0, 1, 3);
}
and the actual function was setup to hide the button...
Code:
function theFunction(a, b, c) {
//other crap
_root.myButtons[c]._visible = 0;
//other crap
}
doesn't give me an error or anything, just keeps on tickin, but without hiding the button.
edit: i'm sure it's something little somewhere i'm missing. i hate that. ha.
Most (not all) of the above code refers to MC properties. You will need to make your buttons into MCs for this to work. IMHO, this is a better way to go in general anyway, as you can do anything with MCs that you can do with buttons, but you cannot to with buttons anything you can do with MCs.
So, if you convert one of your buttons into an MC, and then use _this(bla bla) then you should have no problems. If it works, do this for all of your buttons.
Huh, I just tried duplicating my advice to help you and noticed the same issue... (guess thats why I dont use buttons in the first place) BUT how come it didnt work when I applied the same array and for loop to movie clips...?
I suppose all along we could have put that code on 'each' button, but theres GOT to be an easier way to group that script than having to do it that way. It was a solution to the problem though, well done!
Sorry about not being the help you hoped you would get...
hope your problem is solved now
Geoff
Originally posted by geoffp08 Huh, I just tried duplicating my advice to help you and noticed the same issue... (guess thats why I dont use buttons in the first place) BUT how come it didnt work when I applied the same array and for loop to movie clips...