vinTagesworld Flash forum
door Sikken op 09-02-07 om 23:04
ik heb 3 movieclips in mijn library : icon1, icon2, icon3
code:
actionscript codevar radiusX = 200;
var radiusY= 75;
var centerX= Stage.width / 2;
var centerY = Stage.height / 2;
var speed = 0.05;
for (var i=1;i<=3;i++){
var t=this.attachMovie("icon"+i,"icon"+i,i++);
t.angle= i* ((Math.PI*2)/3);
t.onEnterFrame = rotate;
}
function rotate(){
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
swf-linkdeze functie mover laat de icons ronddraaien in een "ellips"-baan.
Probleem: enkel de icon2 wordt getoond... Doe ik de declaratie van t verkeerd?

thx!
Damn, deze was moeilijk...het duurde echt 10 minuten voor ik het zag

De oplossing...kei simpel
neem deze regel (skip dus de ++ na i)
var t=this.attachMovie("icon"+i,"icon"+i,i);
Dit topic is gesloten.