potresti fare una cosa del genere se ho capito quello che devi farre
Dovrebbe funzionare anche se non lo ho testato
codice:
valorex=0
valorey=0
//funzione per il preload
preload = function (clip, width, height) {
car = clip.getBytesLoaded();
tot = clip.getBytesTotal();
perc = Math.round((car/tot)*100);
clip.createTextField("testo", 1, (this._width/2), (this._height/2), 200, 20);
clip.testo.wordWrap = true;
testoformat = new TextFormat();
testoformat.color = "0x123466";
testoformat.font = "Verdana";
clip.testo.setTextFormat(testoformat);
if(!isNaN(perc)) {
clip.testo.text = "Caricamento..."+perc+"%";
clip.testo.setTextFormat(testoformat);
}
if (car == tot && car > 1024) {
clearInterval(a);
//richiami la proto per il tween che fai tramite as
clip.tweenTo(valorex, valorey , 5);
clip.testo.text = "";
}
};
//gestire i movimenti con as
MovieClip.prototype.tweenTo= function (x,y,steps) {
this._xstep=(Number(x)-this._x)/Number(steps);
this._ystep=(Number(y)-this._y)/Number(steps);
this._steps=steps;
this.onEnterFrame=function () {
if (this._steps) {
this._x+=this._xstep;
this._y+=this._ystep;
this._steps--;
}
else {
delete this._xstep;
delete this._ystep;
delete this._steps;
this.onEnterFrame=function () {}
}
}
}
Poi richiami il tutto
codice:
on(release){
valorex=200//x da raggiungere col movimento da dove ti trovi alla x in cui deve andare il movimento
valorey=333//y da raggiungere col movimento da dove ti trovi alla y in cui deve andare il movimento
//faccio il loadMovie
_root.mymc.loadMovie("foto.jpg");
//richiami la funzione che gestisce tutto preload e movimento
a = setInterval(preload, 50, _root.mymc, 150, 100);
//150 e 100 sono rispettivamente larghezza e altezza dell'immagine che carichi e che setti come vuoi
}