I have several movieclips in my project which are being used as buttons, and when you rollover the mc's the content is viewable the entire time the mouse is hovering in the area of the movie clip, once the mouse moves off it disapeers. Great. I have the code that allows this to happen, but i have multiple mc's and only one works at a time. Here is the code:
mc.addEventListener(MouseEvent.ROLL_OVER, overHandler);
function overHandler(evt:MouseEvent):void {
mc.gotoAndStop(2);
}
mc.addEventListener(MouseEvent.ROLL_OUT, outHandler);
function outHandler(evt:MouseEvent):void {
mc.gotoAndStop(1);
}
I have tried to add multiple instances of this and change it to 'mc1', but to no avail.
here is what i have also tried:
for(var i:uint = 1; i<=7; i++){
this["mc"+String(i)].addEventListener(MouseEvent.ROLL_OVER);
}
function (evt:MouseEvent):void {
this.setChildIndex(MovieClip(evt.currentTarget), this.numChildren-1);
}
I can't seem to get it to work.