PDA

View Full Version : function reset question


ssipse
03-07-2007, 07:42 PM
I'm using this function to fade out some movie clips on press



function community() {
community = new Array(1, 2, 3, 6, 9, 11, 13, 16, 7);
for (z=0; z<community.length; ++z) {
i = community[z];
_root.cylinder["cylinder_small"+i].fadeout(30);
}
}

on(press){ community()}


It works fine but when movie clips are set back to _alpha 100 and I press that function again, and it doesnt work. It only works first time. Why?

senocular
03-07-2007, 07:44 PM
that all depends what fadeout is.

ssipse
03-07-2007, 07:47 PM
This is code im using to fade out


MovieClip.prototype.fadeout = function(goalalpha) {
this.onEnterFrame = function() {
if (this._alpha>=goalalpha) {
this._alpha -= _global.speed;
} else {
delete this.onEnterFrame;
}
};
};

ssipse
03-07-2007, 09:06 PM
help needed asap