jonBarzini
03-15-2007, 10:07 PM
Hello everyone,
I am new to this forum and sort of new to actionscript.
My question is that I have this prototype:
MovieClip.prototype.easeFade = function(targetAlpha, easing)
{
this.onEnterFrame = function()
{
if (Math.round(this._alpha) == Math.round(targetAlpha)) {
this._alpha = targetAlpha;
delete this.onEnterFrame;
}
else {
var va:Number = (targetAlpha - this._alpha) * easing;
this._alpha += va;
}
};
};
when i set targetAlpha to 0, everything works fine and the onEnterFrame is deleted. but when i set the targetAlpha to 100 the this._alpha never reaches 100 so the onEnterFrame is never deleted and continues forever.
Any help would be much appreciated.
Thanks
p.s. this is also my first time posting on any forum. If i did something wrong please let me know.
I am new to this forum and sort of new to actionscript.
My question is that I have this prototype:
MovieClip.prototype.easeFade = function(targetAlpha, easing)
{
this.onEnterFrame = function()
{
if (Math.round(this._alpha) == Math.round(targetAlpha)) {
this._alpha = targetAlpha;
delete this.onEnterFrame;
}
else {
var va:Number = (targetAlpha - this._alpha) * easing;
this._alpha += va;
}
};
};
when i set targetAlpha to 0, everything works fine and the onEnterFrame is deleted. but when i set the targetAlpha to 100 the this._alpha never reaches 100 so the onEnterFrame is never deleted and continues forever.
Any help would be much appreciated.
Thanks
p.s. this is also my first time posting on any forum. If i did something wrong please let me know.