Ho questo script copiato da qualche parte ma modificato in alcuni punti. L’ho inserito nel primo frame della timeline.
_root.square.loadMovie("tua.jpg");
MovieClip.prototype.loadingPic = function() {
this.onEnterFrame = function() {
c = this.getBytesLoaded();
trace(c);
// bytes caricati
t = this.getBytesTotal();
// bytes totali
p = Math.round((c*100)/t);
_root.barra1._xscale = Math.round((c/t)*100);
// calcolo della percentuale
if (c == t) {
trace("caricato");
// fai le istruzioni che vuoi
square._alpha = 0;
_root.quadro.onEnterFrame = function() {
this._width += (Math.round(square._width)-Math.round(this._width))/5;
this._height += (Math.round(square._height)-Math.round(this._height))/5;
if (Math.round(this._width) == Math.round(square._width)) {
delete this.onEnterFrame;
_root.onEnterFrame = function() {
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
};
}
};
stop();
delete this.onEnterFrame;
}
};
};
square.loadingPic();


Rispondi quotando
