I’m currently creating a project that requires a counter to determine the number of movieclips that have reached a certain Y value.
var righthiptime:Timer = new Timer(3);
function righthipfall(event:TimerEvent): void {
righthip_mc.y++;
righthip_mc.rotation++;
if (righthip_mc.y==750) {
righthiptime.stop();
counter++;
}
}
righthiptime.addEventListener(TimerEvent.TIMER, righthipfall);
righthip_mc.addEventListener(MouseEvent.MOUSE_DOWN, righthiptimer);
function righthiptimer(event:MouseEvent): void {
righthiptime.reset();
righthiptime.start();
}
There are 41 sets of these functions, one for each movieclip. When the counter reaches 41, there is an if statement that causes a second set of movieclips to be visible.
if (counter==40) {
mhead_mc.visible=true;
mbelly_mc.visible=true;
mbelly1_mc.visible=true;
mchest_mc.visible=true;
mleftarm_mc.visible=true;
mleftarm2_mc.visible=true;
mleftshoulder_mc.visible=true;
mrightarm_mc.visible=true;
mtit_mc.visible=true;
mpelvis_mc.visible=true;
}
does this statement need to be inside of a function? Regardless, it’s not working. Any scripting tips?