Ho letto solo ora il pvt
l'effetto è fatto così
codice:
foto._visible = 0;
MovieClip.prototype.move = function(targetRot, targetXsc, targetYsc, targetX, targetY) {
this._rotation += (targetRot-this._rotation)/4;
this._xscale += (targetXsc-this._xscale)/4;
this._yscale += (targetYsc-this._yscale)/4;
this._x += (targetX-this._x)/4;
this._y += (targetY-this._y)/4;
if (
Math.round(this._x) == this.__oldx &&
Math.round(this._y) == this.__oldy &&
Math.round(this._xscale) == this.__oldsx &&
Math.round(this._yscale) == this.__oldsy &&
Math.round(this._rotation) == this.__oldr &&
this.onEnterFrame != undefined
) {
this._rotation = targetRot;
this._x = targetX;
this._y = targetY;
this._xscale = targetXsc;
this._yscale = targetYsc;
delete this.onEnterFrame;
} else {
this.__oldr = Math.round(this._rotation);
this.__oldx = Math.round(this._x);
this.__oldy = Math.round(this._y);
this.__oldsx = Math.round(this._xscale);
this.__oldsy = Math.round(this._yscale);
}
};
_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;
}
};
}
Poi in libreiria ti devi creare un movieclip quadrato/rettangolo
questo movie clip che istanzi rettangolo lo devi mettere in un ulteriore mc che linkerai da libreria tasto destro sul mc linkage o concatenamento e gli darai su esporta per AS il nome IDmaschera
poi avrai l'immagine da mascherare in un mc con nome istanza foto