Código:
View:[URL="http://www.zeandesign.net/as3/"]http://www.zeandesign.net/as3/[/URL]import flash.ui.Mouse; import flash.events.Event; import caurina.transitions.Tweener; import gs.TweenLite; import gs.*; import noponies.display.FullBrowserBg; import gs.easing.*; var loader:Loader = new Loader(); // creamos un loader //Background var newBrowserBg:FullBrowserBg = new FullBrowserBg("images/background/bg.jpg", false); addChildAt(newBrowserBg,0) // Alinamiento de posición en pantalla stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE, onResize); function onResize (evt:Event = null) { header_mc.x = 0; header_mc.y =0; header_mc.width = stage.stageWidth; loader.x =(stage.stageWidth - loader.width) * 0.5; loader.y =(stage.stageHeight - loader.height) * 0.5; } // END onResize onResize(new Event(Event.RESIZE)); //swf por default de entrada var defaultSWF:URLRequest = new URLRequest("app/home.swf"); loader.x =(stage.stageWidth - loader.width) * 0.5; loader.y =(stage.stageHeight - loader.height) * 0.5; loader.load(defaultSWF); addChild(loader); //Funciones function btnClick(event:MouseEvent):void { removeChild(loader); var newSWFRequest:URLRequest =new URLRequest("app/" + event.target.name + ".swf"); loader.x =(stage.stageWidth - loader.width) * 0.5; loader.y =(stage.stageHeight - loader.height) * 0.5; loader.load(newSWFRequest); addChild(loader); } //Navegación home.addEventListener(MouseEvent.CLICK, btnClick); about.addEventListener(MouseEvent.CLICK, btnClick); //contacto.addEventListener(MouseEvent.CLICK, btnClick);
Saludos.