Thanks Fruitbeard, though I wasn't able to successfully use a variable to compare against. I got it working but it wouldn't loop endlessly, rather it still got stuck on frame 1. For anyone looking for a simple solution, what I ended up doing is far less elegant though it works:
I created two frames inside of "trash_mc" so that instead of having the animation on "trash_mc"'s timeline, I could have it only on frame 2 inside of an mc called "trashInside_mc". This way with a stop action on top, the 1st keyframe is just the bitmap of the trash and the 2nd keyframe plays the animation. Now I can code the "trash_mc" timeline to toggle back and forth between the static and animated trash.
The code on the main timeline to trigger it is simply:
And then inside of "trash_mc" is a simple event listener on frame 2 to stop the animation:Code:trashTrigger_mc.addEventListener(MouseEvent.MOUSE_OVER, wastebasketMover); function wastebasketMover(e:MouseEvent):void { trash_mc.nextFrame(); }
Code:trashInside_mc.addEventListener(MouseEvent.CLICK, backToStart); function backToStart(event:Event):void { gotoAndPlay(1); }




Reply With Quote
