Ho cambiato la prototype, con la tua ma il problema della cpu al 50% mi rimane.
Dove sbaglio così è come ho scritto il codice
codice:foto._visible = 0; MovieClip.prototype.move = function(targetRot, targetXsc, targetYsc, targetX, targetY) { this._rotation = this._rotation+(targetRot-this._rotation)/4; this._xscale = this._xscale+(targetXsc-this._xscale)/4; this._yscale = this._yscale+(targetYsc-this._yscale)/4; this._x = this._x+(targetX-this._x)/4; this._y = this._y+(targetY-this._y)/4; if( this.__math == undefined ) { this.__math = Math; } if( this.__math.round( this._x ) == this.__oldx && this.__math.round( this._y ) == this.__oldy && this.__math.round( this._xscale ) == this.__oldsx && this.__math.round( this._yscale ) == this.__oldsy && this.onEnterFrame != undefined ){ this._x = targetX; this._y = targetY; this._xscale = targetXsc; this._yscale = targetYsc; delete this.onEnterFrame; } else { this.__oldx = this.__math.round( this._x ); this.__oldy = this.__math.round( this._x ); this.__oldsx = this.__math.round( this._x ); this.__oldsy = this.__math.round( this._x ); } }; _root.attachMovie("IDmaschera", "maschera", 100); _root.maschera.rettangolo._visible = 0; _root.maschera._x = 550; _root.maschera._y = 70; j = 0; for (i=1; i<=50; i++) { duplicateMovieClip(_root.maschera.rettangolo, "rettangolo"+i, i); //trace("rettangolo"+i); _root.maschera["rettangolo"+i].targetX = (1/2*foto._width)-(1/2*maschera._width)-(j*maschera._width); j++; if (i/10 == Math.round(i/10)) { j = 0; } _root.maschera["rettangolo"+i].targetY = (-1/2*foto._height)+(1/2*maschera._height)+(Math.floor((i-1)/10)*maschera._height); _root.maschera["rettangolo"+i]._xscale = 1; _root.maschera["rettangolo"+i]._yscale = 1; _root.maschera["rettangolo"+i]._rotation = -170; _root.maschera["rettangolo"+i].rit = 50*i; t0 = getTimer(); _root.maschera["rettangolo"+i].onEnterFrame = function() { if (getTimer()-t0>=this.rit) { this.move(180, 100, 100, this.targetX, this.targetY); _root.foto.setMask(maschera); foto._visible = 1; _root.maschera.rettangolo._xscale = 1; _root.maschera.rettangolo._yscale = 1; } }; }

Rispondi quotando