eduardosavoine

Application

Dec 6th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 2.49 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                xmlns:s="library://ns.adobe.com/flex/spark"
  4.                xmlns:mx="library://ns.adobe.com/flex/mx"
  5.                width="950" height="620" minWidth="950" minHeight="620" backgroundAlpha="1.0"
  6.                backgroundColor="#808080" creationComplete="{doInit()}" currentState="PRIN010"
  7.                >
  8.  
  9.     <s:states>
  10.         <s:State name="SNHA010"/>
  11.         <s:State name="PRIN010"/>      
  12.         <s:State name="ADSD30A"/>
  13.         <s:State name="SNHA020"/>
  14.     </s:states>
  15.            
  16.     <fx:Script>
  17.         <![CDATA[
  18.             import components.AlertObject;
  19.            
  20.             import mx.controls.Alert;
  21.             import mx.controls.SWFLoader;
  22.             import mx.core.IVisualElementContainer;
  23.            
  24.             private function doInit():void
  25.             {
  26.                 addSubApplication(nav_PaginaInicial, "PaginaInicial.swf");
  27.             }
  28.            
  29.             private function addSubApplication(navigatorName:IVisualElementContainer, nameSubApplication:String):void
  30.             {
  31.                 navigatorName.removeAllElements();
  32.                 var swfLoadSubApplication: SWFLoader = new SWFLoader();
  33.                 swfLoadSubApplication.percentWidth = 100;
  34.                 swfLoadSubApplication.percentHeight = 100;
  35.                 swfLoadSubApplication.source = nameSubApplication;
  36.                 navigatorName.addElement(swfLoadSubApplication);               
  37.             }
  38.            
  39.             protected function navigatorContent_Click(event:MouseEvent):void
  40.             {
  41.                 //Alert.show("navigatorContent is clicked: " + event.currentTarget.selectedItem.id);               
  42.                 if (event.currentTarget.selectedItem.id == nav_PaginaInicial.id)
  43.                     addSubApplication(event.currentTarget.selectedItem, "PaginaInicial.swf");
  44.  
  45.                 if (event.currentTarget.selectedItem.id == nav_Graficos.id)
  46.                     addSubApplication(event.currentTarget.selectedItem, "Graficos.swf");
  47.             }
  48.            
  49.         ]]>
  50.     </fx:Script>
  51.    
  52.    
  53.     <!-- PRIN010 !-->
  54.     <s:VGroup includeIn="PRIN010" left="10" right="10" top="10" bottom="10" verticalCenter="0" horizontalCenter="0" gap="0">
  55.         <s:VGroup width="100%" height="100%" gap="0">
  56.             <s:Group width="100%" height="20">
  57.                 <s:TabBar id="tabBar" height="100%" dataProvider="{viewStack}" right="5" click="navigatorContent_Click(event)"/>   
  58.             </s:Group>         
  59.             <mx:ViewStack id="viewStack" width="100%" height="100%">               
  60.                 <s:NavigatorContent id="nav_PaginaInicial" label="Pagina Inicial"/>            
  61.                
  62.                 <s:NavigatorContent id="nav_Graficos" label="Gráficos"/>
  63.                
  64.                 <s:NavigatorContent id="nav_Chamados" label="Chamados"/>
  65.                
  66.                 <s:NavigatorContent id="nav_Equipamentos" label="Equipamentos"/>
  67.             </mx:ViewStack>        
  68.         </s:VGroup>
  69.     </s:VGroup>
  70. </s:Application>
  71.  
Advertisement
Add Comment
Please, Sign In to add comment