fai il preload dell'img esterna quando sei sicuro che sia caricata la fai spostare prima in alto e poi la centri con le tween
con una cosa del genere..
metti la funzione fuori dal preload sempre sul frame
import mx.transitions.Tween;
import mx.transitions.easing.Regular;
function sposta(mc, finex,finey) {
var ___TWEEN___:Tween = new Tween(mc, "_x", Regular.easeOut,mc._x, finex, 30, false);
var ___TWEEN___:Tween = new Tween(mc, "_y", Regular.easeOut,mc._y, finey, 30, false);
}
x richiamarla nel preload
sposta(istanzaclipdaSpostare,coordinataxDiArrivo,c oordinatayDiArrivo)
ovviamente la fai spostare prima il alto e poi la centri con le coordinate
Stage._width/2
Stage._heigth/2
xrò magari ti servirebbe un listener che ti avverte quando avrà concluso il primo movimento
spostato=false
function sposta(mc, finex,finey) {
var ___TWEEN___:Tween = new Tween(mc, "_x", Regular.easeOut,mc._x, finex, 30, false);
var ___TWEEN___:Tween = new Tween(mc, "_y", Regular.easeOut,mc._y, finey, 30, false);
var tweenListener:Object = new Object();
//
tweenListener.onMotionFinished = function():Void {
trace("finito1"° movimento);
//richiami qua di nuovo la stessa funzione che xrò centrerà l'img
if(!spostato){
sposta(istanzaclipdaSpostare,Stage._width/2,Stage._heigth/2)
spostato=true
}
};
___TWEEN___.addListener(tweenListener);
}
![]()