ho trovato e seguito la guida di And80
ho fatto cosi
codice:
import caurina.transitions.Tweener;
Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;
bg_mc._x = 0;
bg_mc._y = 0;
bg_mc._width = Stage.width;
bg_mc._height = Stage.height;
var my_color:Color = new Color(bg_mc);
my_color.setRGB(color);
var mcListener:Object = new Object();
mcListener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;
trace("Attivato Evento Start, l'immagine sta caricando");
};
mcListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var percentual:Number = Math.floor((bytesLoaded/bytesTotal)*100);
percentuale.text = "Caricato "+percentual+"%";
};
mcListener.onLoadComplete = function(target_mc:MovieClip) {
target_mc._alpha = 100;
percentuale.text = "";
trace("Attivato Evento Complete, l'immagine ha terminato il caricamento");
};
mcListener.onLoadInit = function(target_mc:MovieClip) {
trace("Larghezza: "+target_mc._width);
trace("Altezza: "+target_mc._height);
newW = target_mc._width / 2;
newH = target_mc._height / 2;
Tweener.addTween (target_mc,{_x:(Math.floor (Stage.width / 2))- newW, _y:(Math.floor (Stage.height / 2))- newH, time:1, transition:"easeoutexpo"});
};
mcListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
if (errorCode == "URLNotFound") {
trace("Errore, l'immagine non è stata trovata, file sconosciuto");
} else if (errorCode == "LoadNeverCompleted") {
trace("Errore, caricamento interrotto, probabile sovraccarico del server, riprovare più tardi");
} else {
trace("Errore generico, il server non ha risposto in tempo, oppure l'immagine risulta danneggiata o non è un'immagine");
}
};
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(mcListener);
mcLoader.loadClip(swf, mc);
Tweener.addTween (mc,{_x:(Math.floor (Stage.width / 2))- newW, _y:(Math.floor (Stage.height / 2))- newH, time:1, transition:"easeoutexpo"});
var resizer:Object = {};
resizer.onResize = function () {
bg_mc._width = Stage.width;
bg_mc._height = Stage.height;
bg_mc._x = 0;
bg_mc._y = 0;
newW = mc._width / 2;
newH = mc._height / 2;
Tweener.addTween (mc,{_x:(Math.floor (Stage.width / 2))- newW, _y:(Math.floor (Stage.height / 2))- newH, time:1, transition:"easeoutexpo"});
};
Stage.addListener (resizer);
ma non riesco a centrarla sullo stage, risulta cmq spostata...
mmm....
su forza!!! oggi è la festa della donna