Ya know in Flash MX you can assign an instance name to a button… well what’s it good for???
I wanted to make a button that when you rollover it then an animation inside it will play… (of course I have a stop() action on the first frame of the mc)
Let’s say that the inst-name of the button is “btn” and the mc inside it “mc”
so I kinda put it like this:
on(rollOver) {
_root.btn.mc.play();
}
but nothin’ :-\
I mean… If I can’t use it like this… What’s it good for???
:-\ :-\ :-\
well… I like have a movieclip inside the button… in all the frames (up, over, down, hit)
and inside that movieclip there is an animation, and in the first frame there is stop() action so it won’t play it by itself…
and on the button I have the actions
on(rollOver) {
_root.btn.mc.play();
}
“btn” is the instance name of the button, and “mc” is the instance name of the mc.
so if I rollOver the button, it should play the anim inside the mc… but it won’t… :-\ :*(
clear enough?
I think the point of button instnace names is to be able to to execute a button through frame actions instead of on the button itself, but I am not 100% on that.
Why dont you just put the animation in the OVER frame of the button and not have a stop action on the MC. Then when the mouse rolls over the button will advance to the frame with the MC ready to play. I am a bit confused with what you are trying to accomplish - but from what I got this should do it without any code.
Syko >> why do you go back to the _root to target your movie clip, when all you have to do is play it from where you are?
LostinBeta >> you’re right on that one. Instance names of buttons are used with dynamic event handlers. For instance, if you try to name a button myButton and then put the code
on (press) {trace (this._name);}
it will return nothing. But if you put a dynamic event handler