You know, I used to know AS2. It was fun. It was easy. And then after a break I've tried to pick up AS3 and everything is going horribly, horribly wrong. Even searching online forums I can't work out how to get the solution I need. I could revert back to AS2, but I am determined I am not going to let AS3 beat me. Someone please help!
I am trying to add Next and Back buttons that will jump users between keyframes.
I have a layer called Actions, and a layer called Buttons. The Buttons layer has two buttons of different types with Instance Names of "btn_Next" and "btn_Back" respectively.
Both layers have keyframes at frame 30 and frame 60.
The actions on frame 30 and frame 60 both say "stop();"
At present the action on frame 1 on the Actions layer says:
import flash.events.MouseEvent;
stop();
btn_Back.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent):void
{
prevFrame();
}
btn_Next.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void
{
nextFrame();
}
When I press Ctrl + Enter I am currently getting the error message
"TypeError: Error #1123: Filter operator not supported on type builtin.as$0.MethodClosure. at [Filename]_fla::MainTimeline/frame1()"
and the buttons do nothing.
Where am I going wrong?
The thing I get particularly confused about reading other posts is whether I need to reproduce this code on each keyframe, or only on Frame 1 of the Actions layer. I tried adding it to each keyframe, but then got errors about duplicating my functions. So I tried removing the functions from all keyframes after the first one, but that didn't work either.
I tried changing my instance names on each keyframe and changing the code on each keyframe, but that didn't seem to work either. And it seems like a really inefficient way to do things.
Someone please help me.
Mary