cmq cerco di spegare meglio quello che ho fatto
ho creato un swf e tramite le istruzioni da te indicate (moltoo utili)sono riuscito a creare una pag a schermo intero con sfondo sfumato (100%) e al centro indipendenemente dalla risoluzione un mc di dimensioni fisse di 800x600 utilizzando questo codice
codice:
var createPattern:Function = function( path:Object, pattern:String ):Void {
path.createEmptyMovieClip( 'StageBackground_0', path.getNextHighestDepth() );
path['StageBackground_0'].attachMovie( pattern, pattern, path.getNextHighestDepth() );
var totX:Number = new Number( Math.ceil( Stage.width / path['StageBackground_0']._width ) );
var totY:Number = new Number( Math.ceil( Stage.height / path['StageBackground_0']._height ) );
var c:Number = new Number( 1 );
for( var a:Number = 0; a <= totY; a++ ) {
var newY:Number = ( path['StageBackground_0']._y + path['StageBackground_0']._height ) * a;
for( var b:Number = 0; b < totX; b++ ) {
var newX:Number = ( path['StageBackground_0']._x + this['StageBackground_0']._width ) * b;
var newName:String = 'StageBackground_' + String( c );
path['StageBackground_0'].duplicateMovieClip( newName, path.getNextHighestDepth() );
path[newName].attachMovie( 'pattern', 'pattern', path.getNextHighestDepth() );
path[newName]._x = newX;
path[newName]._y = newY;
c++;
}
}
}
var removePattern:Function = function( path:Object ):Void {
var c:Number = 0;
while( path['StageBackground_'+String(c)] != undefined ) {
path['StageBackground_'+String(c)].removeMovieClip();
c++;
}
}
var stageListener:Object = new Object();
stageListener.path = this;
stageListener.onResize = function():Void {
this.path.removePattern( this.path );
this.path.createPattern( this.path, 'pattern' );
this.path['main'].swapDepths( this.path.getNextHighestDepth() );
}
Stage.scaleMode = 'noScale';
Stage.align= 'TL';
Stage.addListener( stageListener );
stageListener.onResize();
this.createEmptyMovieClip( 'main', this.getNextHighestDepth() );
this['main'].attachMovie( 'mainWindow', 'mainWindow', this.getNextHighestDepth() );
this['main'].onEnterFrame = function():Void {
this._x = Math.floor( Stage.width/2 - this._width/2 );
this._y = Math.floor( Stage.height/2 - this._height/2 );
}
ovviamente ho creato anche 2 mc >>proprietà concatemamento linkato mainWindow allo stesso modo per main
tutto ok
adesso vorrei che alla pressione di un tasto riuscire a caricare un swf esterno in modo tale da ereditare le proprietà di mainWindow
quindi cosa mi converrebbe fare caricare i diversi swf nel mc mainWindow oppure crearne uno vuoto in cui metterci di volta in volta l'swf caricato?? e poi questi si centrerà sempre come mainWindow fa adesso
spero di essere stato abbastanza chiaro
e grazie ancora