PDA

View Full Version : [FMX/2004] fadeIn prototype, run by multiple objects at the same time



quik
June 23rd, 2004, 09:54 PM
I have the following prototype, which is used by typing objName.fadeIn(100, 3);
this is all well and good, although when I start to use it on multiple mc's at once the playback becomes quite choppy and nasty... any ideas dudes?


MovieClip.prototype.fadeIn = function(v, r) {
this.onEnterFrame = function() {
if (this._alpha<v) {
this._alpha += r;
} else {
delete this.onEnterFrame;
}
};
};

defcon4
June 28th, 2004, 10:52 AM
if all the clips are happening at exactly the same time flash bogs down. one way i fixed an issue similar is by creating my clips w/ a function and timing the function execute to be a few milliseconds apart (which seems to help flash cope with multiple processes efficiently). basically its slowing down because its taxing your cpu pretty hard at once. this can be even worse for low end machines.