For loop v setinterval?

i’m trying to tween an mc from alpha 0 to 100 with code

for(x=1; x<100; x++) {
myClip_mc._alpha =x;
}

the above is way too fast - so i trieda nested loop

i = 1;
for(x=1; x<10000; x++) {
// slow down i’s increment
i = (x / 100);
myClip_mc._alpha =i;
}

i’m not sure that’s making any difference - my maths is hit-and-miss

still, the clip seems to tween too fast

could i use setinterval here and/or could somebody give me a hint as to how to achieve my goal?

cheers
=)

Try this instead:


onClipEvent(load){
alphaAMT = 0; //this can be between 0 and 100
speed = 3; //this can be any positive integer but 1 to 5 is preferrable
}
onClipEvent(enterFrame){
this._alpha += (alphaAMT - this._alpha)/speed;
}

Cheers!

hi and cheers for your help!

that works fine now
:slight_smile: