PDA

View Full Version : Timer


L.O.S.
09-19-2005, 09:57 AM
I have an object that grows (immediately). But I want it to shrink back to almost nothing after 10 seconds.

function imgIt() {
var i:Number = 0;
var xoo:Number = 450.1;
var moo:MovieClip = attachMovie("circle", "circle", 7);
moo.onEnterFrame = function() {
if (i<=xoo) {
newSize = Math.ceil((xoo-moo._width)/2);
moo._width += newSize;
moo._height += newSize;
moo._y = 130;
moo._x = 200;
} else {
onEnterFrame = null;
}
i++;
};
}

hobbis
09-19-2005, 12:27 PM
Use SetInterval. When the movieclip has grown to full size, tigger the SetInterval function, which you can set to run at 10 second intervals, this can call a function (so you will have to name your function).