Descargue este código de internet:
Cita:
Pero en el código utiliza 3 elementos que son:import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener (Event.RESIZE, resizeHandler);
// initialize sizing
resizeHandler (null);
function resizeHandler (event:Event):void {
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
header_mc.width = body_mc.width = footer_mc.width = sw;
body_mc.height = sh-header_mc.height-footer_mc.height;
footer_mc.y = sh-footer_mc.height;
}
import flash.display.StageAlign;
import flash.events.Event;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener (Event.RESIZE, resizeHandler);
// initialize sizing
resizeHandler (null);
function resizeHandler (event:Event):void {
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
header_mc.width = body_mc.width = footer_mc.width = sw;
body_mc.height = sh-header_mc.height-footer_mc.height;
footer_mc.y = sh-footer_mc.height;
}
header_mc
body_mc
footer_mc
Y funciona bien, pero sí yo solo tengo 1 (por ejemplo body_mc) como quedaría el código?.
Gracias por su ayuda