Hi,
I'm Simon, and I'm quite new to ActionScript 3.0 but I think it's fun to learn.
I've got a problem and would be very glad for your helping
On the stage, I've got 4 boxes (shapes) which all are MovieClips and each has 11 frames with different drawed symbols. When a box, inside it's movieclip, comes to a frame, I've written stop(); there so it stays at the current drawed symbol.
On the frame 1 in each box, there is nothing, and I if the MovieClip is stop on frame 1, there are nothing drawed, so it is empty.
All boxes has instance name, first: box_1, second: box_2 and so on...
In another MovieClip on stage, I've written this function. I want the loop to find the first "empty box" (which is stop at frame 1) and then move that MovieClip to frame 3 and stop.
So, if box_1 is at frame 3, it will check if box_2 is at frame 1 and so on
ActionScript Code:
function findBox (event) {
for (var i:int = 0; i < 4; i++) {
if (MovieClip(root).box_+i.currentFrame == 1) {
MovieClip(root).box_+i.gotoAndStop(3);
break;
}
I would be very glad if someone could explain how to write this.
Thanks
/Simon