I have an iOS app where the player “wins” a little fireworks game when they successfully complete a puzzle.
It creates a new blank movie clip on the very top layer that’s the size of the entire stage, so the game basically freezes and you can touch anywhere on the screen and a firework explodes.
It works just fine on my computer, it’s just a simple timeline animation, it’s not complicated, but when I put it on an iPad it FREAKS. OUT. And it’s not (necessarily) a memory leak because it’s slow from the very beginning, on my computer it takes a firework about 2 seconds to explode, on my iPad it’s like 15 seconds and of course gets slower with each firework added.
The frame rate is 24.
Any ideas? Surely the iPad doesn’t freak out at a simple timeline animation.
This is the call:
function explodeFirework (e:MouseEvent): void {
explode.play();
var fw:Explosion = new Explosion();
var randomColor:int = int(Math.random()*0xffffff);
var newColorTransform:ColorTransform = fw.transform.colorTransform;
newColorTransform.color = randomColor;
fw.transform.colorTransform = newColorTransform;
fw.x = e.stageX;
fw.y = e.stageY;
bmcFW.addChild(fw);
}
And Explosion is just a timeline animation with a bunch of sprites moving along paths. The last frame of Explosion is
this.parent.removeChild(this);
stop();
Is there a way to fix this?
If not, does anyone have any other ideas?