samedi 3 décembre 2016

Creating instances in loop freezes app

I have a movie clip exported for actionscript as a class and i am creating many instances from it inside a loop and adding it to stage.
when i test the app on mobile it freezes for a second when the loop starts and then everything works back.
that is an example of how it looks.

for(var i:int = 0; i < 20; i++)
   var mc:MC = new MC();
   mc.textField.text = "mc"+i;
   mc.y = i * mc.height;

so i am asking if there is a better way to do it without freezing?

Aucun commentaire:

Enregistrer un commentaire