I’ve got some code working in a flash banner but google needs it to stop looping and I can’t work out how to make it loop for 3 times! I would have thought that the for (var i=0;i<numOfItems;i++) would make it stop when it reached three loops. The code is:
var numOfItems:Number = 3;
var radiusX:Number = 150;
var radiusY:Number = 50;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.03;
for (var i=0;i<numOfItems;i++)
{
var t = this.attachMovie(“item”,“item”+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = this._y / (centerY+radiusY);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
I’d either like it to stop after a certain amount of loops, or after 12 seconds, or on a specific frame whatever is easiest!