Can someone please tell me, why this script causes my movie to go haywire when I add something to the stage such as a scroller(even a UIScrollbar):
//--- Tutorial project file provided courtesy of SchoolofFlash.com ---//
aboutBmc.buttonMode = true;
resumeBmc.buttonMode = true;
pressBmc.buttonMode = true;
fansBmc.buttonMode = true;
contactBmc.buttonMode = true;
homeBmc.buttonMode = true;
aboutBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
aboutBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
resumeBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
resumeBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
pressBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
pressBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
fansBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
fansBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
contactBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
contactBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
homeBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
homeBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
function onButtonOver(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("over");
}
function onButtonOut(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("out");
}
I am using this script on some buttons to give them a rollover/rollout effect. Like I mentioned, when I add a scrollbar to the stage and play the movie, the buttons keep looping the effect(ignoring all the the "stop" actions)and the scroll bar blinks erratically. Thanks for your help.
Anthony
P.S. I also am not sure how to give the buttons a directive such as getUrl since I am trying this movieclip as button idea. First time using AS3.





(feeling 3rd grader-ish today, don't mind me)

Bookmarks