Simple actionscript question
I have a project I'm working on and I'm new to actionscript 3. Below is the code that i have on frame 1 and it works fine for one button.
import flash.events.MouseEvent;
stop();
//--- Buttons
buy_btn.addEventListener(MouseEvent.MOUSE_OVER, buyROLL);
buy_btn.addEventListener(MouseEvent.MOUSE_OUT, buyOUT);
function buyROLL(event:MouseEvent):void {
buy_mov.gotoAndPlay(2);
}
function buyOUT(event:MouseEvent):void {
buy_mov.gotoAndPlay(15);
}
When I try to add multiple buttons like the code below, flash freaks out! It doesn't even stop on the first frame. It plays the movie straight through. I get these errors "Scene 1, Layer 'Layer 2', Frame 1, Line 20 1120: Access of undefined property about_mov." and "Scene 1, Layer 'Layer 2', Frame 1, Line 23 1120: Access of undefined property about_mov."
import flash.events.MouseEvent;
stop();
//--- Buttons
buy_btn.addEventListener(MouseEvent.MOUSE_OVER, buyROLL);
buy_btn.addEventListener(MouseEvent.MOUSE_OUT, buyOUT);
about_btn.addEventListener(MouseEvent.MOUSE_OVER, aboutROLL);
about_btn.addEventListener(MouseEvent.MOUSE_OUT, aboutOUT);
function aboutROLL(event:MouseEvent):void {
about_mov.gotoAndPlay(2);
}
function aboutOUT(event:MouseEvent):void {
about_mov.gotoAndPlay(15);
}
Am I doing this right??? Is there an easier, more efficient way to do this?