Ciao a tutti,
Scusate ma sono alle prime armi con flash e nn ci capisco molto, avevo l'esigenza di creare un'animazione che disegnasse il contorno di un logo per poi far apparire il logo stesso, sul web ho trovato questo actionscript...
solo ke ho un problema... finito il disegno nel contorno non c'è modo di farlo andare via, cioè alla fine mi ritrovo ad avere il logo ed il suo contorno..
![]()
![]()
questo è l'actionscript:
MovieClip.prototype.traccia_contorno = function(alpha, spessore, colore, qualita) {
this._alpha = alpha;
// ----------------------------------------------------
this.effetto = _root.createEmptyMovieClip("contorno" + this._name, 1000 + _root.stage++);
this.effetto.lineStyle(spessore, colore, 100);
// ----------------------------------------------------
var cos_mini = Math.cos(0.03);
var sin_mini = Math.sin(0.03);
// ----------------------------------------------------
this.test_X = 2000;
this.test_Y = 2000;
// ----------------------------------------------------
while (!this.hitTest(this._x + this.test_X, this._y + this.test_Y, true)) {
this.test_X--;
this.test_y--;
}
// ----------------------------------------------------
this.depart_x0 = this._x + this.test_X;
this.depart_y0 = this._y + this.test_y;
this.x0 = this.depart_x0;
this.y0 = this.depart_y0;
this.x1 = this.x0 + qualita;
this.y1 = this.y0 + qualita;
// ----------------------------------------------------
this.onEnterFrame = function() {
var ascissa_X = this.x0 - this.x1;
var ascissa_Y = this.y0 - this.y1;
// ----------------------------------------------------
memoria = ascissa_Y;
ascissa_Y = -ascissa_X;
ascissa_X = memoria;
while (!this.hitTest(this.x0 + ascissa_X, this.y0 + ascissa_Y, true)) {
memoria = ascissa_X * cos_mini - ascissa_Y * sin_mini;
ascissa_Y = ascissa_Y * cos_mini + ascissa_X * sin_mini;
ascissa_X = memoria;
}
// ----------------------------------------------------
this.x1 = this.x0;
this.y1 = this.y0;
this.effetto.moveTo(this.x0, this.y0);
this.x0 += ascissa_X;
this.y0 += ascissa_Y;
this.effetto.lineTo(this.x0, this.y0);
// ----------------------------------------------------
if ((Math.abs(this.depart_x0 - this.x0) + (Math.abs(this.depart_y0 - this.y0)) < qualita)) {
delete this.onEnterFrame;
this.onEnterFrame = function() {
this._alpha += (0 - this._alpha) / 0;
if (this._alpha > 0) {
this.swapDepths(0 + _root.stage++);
delete this.onEnterFrame;
}
};
}
};
};
// ----------------------------------------------------
//--> _root.nomemovieclip.traccia_contorno(0,0,0,0)
//--> proprietà grafiche della traccia (alpha, spessore, colore, qualita)
_root.logo.traccia_contorno(0, 1, 0x004e85, 5);
// ----------------------------------------------------
Spero ke qualcuno possa aiutarmiiiiii![]()

