Copy link to clipboard
Copied
Hi,
In the animation I prepared, I wrote a code as follows. I created symbols of type MovieClip. What I want to do is briefly as follows:
The Symbol1 symbol I prepared for the value 1 read from the array and the Symbol2 symbol I prepared for the 0 value will work. However, I have a problem like this.
1- Animation works non-stop. I want to run the symbols I add only when the condition is true. However, my animation is repeated infinitely. The for loop doesn't work step by step. As I understand it, the for loop is completed first and then the animation is shown.
How can I solve this problem? I will be grateful if you could help me.
I wish good work.
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var quest:Array = [1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,0,1];
var len:uint = quest.length;
var bh:Symbol1 = new Symbol1();
var bhs:Symbol2 = new Symbol2();
for(var i:uint = 0; i < len; i++)
{
if(quest[i] == 0)
{
addChild(bh);
bh.x = 415.7;
bh.y = 149.6;
}
else
{
bhs.x = 519.25;
bhs.y = 149.6;
addChild(bhs);
}
}
You put it where you want it to stop.
Copy link to clipboard
Copied
Is there some reason you can't just put a stop() statement in the last frame of the movie clip?
Copy link to clipboard
Copied
I'm new to Animate yet. Do I put it exactly below the code block or do I need to add it to the frame on the layer?
Copy link to clipboard
Copied
You put it where you want it to stop.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now