I’m new to AS3 and I’m currently trying to code a project that allows the user to dissect an image made of movie clips:
var rightniptime:Timer = new Timer(100, 6);
function rightnipfall(event:TimerEvent): void {
rightnip_mc.y+=100;
rightnip_mc.rotation-=15;
}
rightniptime.addEventListener(TimerEvent.TIMER, rightnipfall);
rightnip_mc.addEventListener(MouseEvent.MOUSE_DOWN, rightniptimer);
function rightniptimer(event:MouseEvent): void {
rightniptime.reset();
rightniptime.start();
}
I have literally duplicated this bit of code for the sixty movieclips that comprise this image. This would be fine, but I need another image (again, comprised of about sixty movieclips) to appear, and have the same functionality as the first, once the pieces of the first image have left the stage.
I have been reading articles about classes, creating classes; my teacher gave me vague advice about creating a number that increments as the images fall and then creating a conditional statement that would display the new image once the pieces of the first have reached a particular Y location. But at this point I’m on the verge of tears and can’t seem to make it work.
Someone suggested Tweenlite, but I couldn’t figure it out. I’m a newbie, without friends who understand this stuff. I need help!