Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : fade out button



mijimicheallea
3/27/2004 7:28:29 PM
InstanceName.onRollOver = function () { InstanceName.onEnterFrame = function()
{ if(InstanceName._alpha > 0) { InstanceName._alpha = InstanceName._alpha - 1;
} } }


i pasted that into mx 2004, but i cant get it working.
http://www.leetspace.net/craiglea/whynot.JPG
N Rohler
3/28/2004 12:47:09 AM
InstanceName.onRollOver = function () {
var InstanceName:MovieClip = this;
InstanceName.onEnterFrame = function() {
if(InstanceName._alpha > 0) {
InstanceName._alpha = InstanceName._alpha - 1;
}
}
}

all you have to change in this example is [my instance name].onRollOver

hope this helps
kglad
3/28/2004 1:58:32 AM
i believe that code will work just fine nr, but i also think it might be easier
to follow the code below, in addition, to deleting the enterframe event when
it's no longer needed:

InstanceName.onRollOver = function() {
this.onEnterFrame = function() {
if (this._alpha>0) {
this._alpha--;
} else {
delete this.onEnterFrame;
}
};
};
AddThis Social Bookmark Button