hey guys, i am building my website and am trying to make my button functions modular. Right now i have the rollover effect working the way i want with this code…
function onResumeOver(evt:MouseEvent):void {
resume_btn.gotoAndPlay(“over”);
};
resume_btn.hit_area_mc.addEventListener(MouseEvent.ROLL_OVER,onResumeOver);
function onResumeOut(evt:MouseEvent):void {
resume_btn.gotoAndPlay(“out”);
};
resume_btn.hit_area_mc.addEventListener(MouseEvent.ROLL_OUT,onResumeOut);
But when i tried to make it modular for the otehr buttons im having errors with this code…
function buttonOver(button:MovieClip, evt:MouseEvent):void {
button.gotoAndPlay(“over”);
}
buttonOver(profile_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOver));
buttonOver(downloads_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOver));
buttonOver(resume_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOver));
buttonOver(contact_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOver));
function buttonOut(button:MovieClip, evt:MouseEvent):void {
button.gotoAndPlay(“out”);
}
buttonOut(profile_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOut));
buttonOut(downloads_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOut));
buttonOut(resume_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOut));
buttonOut(contact_btn.hit_area_mc, addEventListener(MouseEvent.ROLL_OUT,buttonOut))
Does anyone see where my problem is? and or a solution.
Thanks