Hey guys. First post.=)
I’m new to AS3 and I’m working on a game that I’ve run into a problem with.
I converted a movie on my main timeline to a movie clip and suddenly my event listeners weren’t working right. I kinda figured I needed to import the mouse event class to make it work, but it didn’t help.
I have 5 AS keyframes that act on a single button (submit_btn) along the mc timeline. This is the code assigned to each keyframe
import flash.events.MouseEvent;
swing_btn.addEventListener(MouseEvent.CLICK,press1);
function press1(evt:MouseEvent):void { MovieClip(root).gotoAndStop(1,“HitsBrianMFSEmerald”); }
It’s a baseball game. The idea is… depending on how early or late you swing, the ball goes different places. There are 3 swing keyframes that span 30 total keyframes. So there are 30 frames where you should ALWAYS get a hit. But for some reason, the majority of the time I click during the 30 frames and, NOTHING happens. Sometimes it works. That’s why it’s confusing.
Suggestions? Thanks!