Problems with coding rollover
Hello everyone, I am making a website with three buttons on the main page, and they are movieclips with instance names box1, box2, and box3. I had my actions in the movieclips themselves, but I want to move the rollover actions to the main timeline (since I want more than one button to move after box1 is rolled over).
Anyways, the main problem is I do not know how I can target a specific movieclip.
This is my code in my main timeline:
Code:
box1.addEventListener(MouseEvent.ROLL_OVER, manageMouseOver, false, 0, true);
box1.addEventListener(MouseEvent.ROLL_OUT, manageMouseOut, false, 0, true);
function manageMouseOver(event:MouseEvent):void{
gotoAndPlay("Over");
}
function manageMouseOut(event:MouseEvent):void{
gotoAndPlay("Out");
}
My old code (worked perfect except I don't know how to make other buttons move as well as "this.") that I put in each movieclip was:
Code:
this.addEventListener(MouseEvent.ROLL_OVER, gotoOver);
function gotoOver(event:MouseEvent):void
{
gotoAndPlay("Over");
}
this.addEventListener(MouseEvent.ROLL_OUT, gotoOut);
function gotoOut(event:MouseEvent):void
{
gotoAndPlay("Out");
}
Thank you in advance,
SK