con esattezza con un'altra action che crea un movieclip "sfondo", anche questà è il risultato di ricerche e consigli vari come la prima, ed è la seguente:
Codice PHP:
import mx.transitions.*;
import mx.transitions.easing.*;
Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;
var drawRectangle:Function = function (target:MovieClip, name:String, level:Number, width:Number, height:Number, color:Number) {
target.createEmptyMovieClip(name, level);
with (target[name]) {
moveTo(0, 0);
lineStyle(0, color, 0);
beginFill(color, 100);
lineTo(width, 0);
lineTo(width, height);
lineTo(0, height);
lineTo(0, 0);
endFill();
}
};
var sfondo:MovieClip = this.createEmptyMovieClip("sfondo", 1);
function entra(movie:MovieClip) {
new Tween(movie, "_y", Regular.easeOut, Math.round(Stage.height/2)-275, Math.round(Stage.height/2)-275, 3, true);
new Tween(movie, "_x", Regular.easeOut, Math.round(Stage.width/2)-200, Math.round(Stage.width/2)-200, 1, true);
}
entra(sfondo);
var mload:MovieClipLoader = new MovieClipLoader();
var mlist:Object = new Object();
mlist.onLoadInit = function(target) {
target._x = Math.round((Stage.width-target._width)/2);
target._y = Math.round((Stage.height-target._height)/2);
target._alpha = 0;
target.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 3;
} else {
delete this.onEnterFrame;
}
};
};
mload.addListener(mlist);
mload.loadClip("esterno.swf", sfondo);
// Permette di aprire tutti i percorsi si "sfondo"...
sfondo._lockroot = true;
// Setto la posizione iniziale di "sfondo"
_level0.sfondo._x = 0;
_level0.sfondo._y = 60;
var fluid:Object = new Object();
fluid.onResize = function() {
_root['resize']();
var sy:Object = new Tween(sfondo, "_y", Regular.easeOut, sfondo._y, Math.round((Stage.height-sfondo._height)/2), 30, false);
var sx:Object = new Tween(sfondo, "_x", Regular.easeOut, sfondo._x, Math.round((Stage.width-sfondo._width)/2), 30, false);
};
Stage.addListener(fluid);
...questa è messa su un livello diverso e a dire la verità funziona pure, solo che "esterno.swf" non sempre è al centro in quanto ci sono alcune pagine con delle maschere laterali (in pratica con oggetti nascosti) che in un certo senso me lo decentroano, o meglio lo scrip appena riportato me lo decentra...non so se sono riuscito a spiegarmi bene...