Solution 1:
On the movieclip on stage replace your script with this:
PHP Code:
onClipEvent (enterFrame)
{
if(_parent._currentframe < 40)
{
getTargetAlpha = function(){
return Math.random() * 100;
};
this.speed = 9; this.target = this.getTargetAlpha();
if(this._alpha < this.target)
{
this._alpha += this.speed;
this.speed;
}
else if(this._alpha > this.target)
{
this._alpha -= this.speed; }else if(this._alpha == this.target)
{
this.target = this.getTargetAlpha;
}
}
}
Where "40" is the frame you wish to stop the animation.
Solution 2:
On your movieclip:
PHP Code:
onClipEvent (enterFrame)
{
if(_parent.finished == false)
{
getTargetAlpha = function(){
return Math.random() * 100;
};
this.speed = 9; this.target = this.getTargetAlpha();
if(this._alpha < this.target)
{
this._alpha += this.speed;
this.speed;
}
else if(this._alpha > this.target)
{
this._alpha -= this.speed; }else if(this._alpha == this.target)
{
this.target = this.getTargetAlpha;
}
}
}
Name your movieclip "mc" or something and On the first frame of the main timeline:
PHP Code:
var finished:Boolean = false;
function delay()
{
clearInterval(Int);
finished = true;
mc._alpha = 100;
}
var Int = setInterval(delay, 30000);
Solution 1 will check for a frame to stop the animation and solution 2 will count to 30 seconds, then stop and set the alpha to 100.
Hope that helps