Monday, June 24, 2013

Adobe Flex 3 UI Components Lifecycle « Armindo Cachada's Blog: Struts 2, Adobe Flex and ATG



1) preInitialize: This event is raised when the component has just been created but none of the child components exist.
2) initialize: This event is raised after the component and all its children have been created but before any dimensions have been calculated.
3) creationComplete: This even is dispatched after all the component and its children have been created and after all the layout calculations have been performed.
4) applicationComplete: Dispatched after all the components of an application have been successfully created



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
preinitialize="preInitialise()"
initialize="initialise()"
applicationComplete="applicationComplete()"
creationComplete="creationComplete()"
viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
private var eventsCalled:ArrayCollection=new ArrayCollection();

public function preInitialise():void
{
eventsCalled.addItem({label: "preInitialise called", event: "preInitialise"});
}

public function initialise():void
{
eventsCalled.addItem({label: "initialise called", event: "initialise"});
}

public function creationComplete():void
{
eventsCalled.addItem({label: "creation complete called", event: "creationComplete"});
}


public function applicationComplete():void
{
eventsCalled.addItem("applicationComplete called");
}
]]>
</mx:Script>
<mx:TabNavigator width="400"
height="400">
<mx:Canvas label="tab1">
<mx:DataGrid id="datagrid"
dataProvider="{eventsCalled}"
top="10"
left="10"
width="300"/>
</mx:Canvas>
<mx:Canvas label="tab2">
<mx:Label text="This label is created only when it is displayed"
 creationComplete="creationComplete();"
 preinitialize="preInitialise();"
 initialize="initialise();"/>
</mx:Canvas>

</mx:TabNavigator>
</mx:Application>

Thursday, June 20, 2013

public var info:IModuleInfo;
            public var customModule:ModuleLoader;
import spark.modules.ModuleLoader;
            protected function hbx_creationCompleteHandler():void
            {
                isIPflag=true;
               

                info =
                    ModuleManager.getModule( "Module.swf");
                info.load();
                customModule = new ModuleLoader;
                var url1:String = "Module.swf";
                customModule.loadModule(url1);
                hbx.removeAllElements();
                hbx.addElement(customModule);
               
               
            }
    <s:HGroup id="hbx"
                                          height="100%"
                                          width="100%" creationComplete="hbx_creationCompleteHandler()">
                                </s:HGroup>


Saturday, December 22, 2012

Loading cascading style sheets on the fly using the Flex StyleManager class

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle">

    <mx:Script>
        <![CDATA[
            import mx.styles.StyleManager;

            private function loadStyles(styleURL:String):void {
                StyleManager.loadStyleDeclarations(styleURL);
            }
        ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
        <mx:ComboBox id="comboBox"
                prompt="Please select a style"
                change="loadStyles(comboBox.selectedItem.data);">
            <mx:dataProvider>
                <mx:Array>
                    <mx:Object label="red" data="styles/red.swf" />
                    <mx:Object label="green" data="styles/green.swf" />
                    <mx:Object label="blue" data="styles/blue.swf" />
                </mx:Array>
            </mx:dataProvider>
        </mx:ComboBox>
    </mx:ApplicationControlBar>

</mx:Application>

Thursday, December 20, 2012

.java-examples Program http://www.javatpoint.com

http://www.java-examples.com/java-collections-and-data-structures-%28-java.util-package-%29


Wednesday, December 19, 2012

Saturday, November 17, 2012

Flex 4.5: Customize Scrollbars

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
  xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="absolute"
  creationComplete="onCreationComplete()" viewSourceURL="srcview/index.html">
 
  <mx:Style>
    ScrollBar
    {
      track-skin: Embed(source='assets/track.png',
              scaleGridLeft="2", scaleGridTop="6",
              scaleGridRight="7", scaleGridBottom="9");
      up-arrow-skin: ClassReference("undefined");
      down-arrow-skin: ClassReference("undefined");
    }
   
  </mx:Style>
 
  <mx:Script>
    <![CDATA[
      import mx.utils.UIDUtil;
      import mx.collections.ArrayCollection;
     
      [Bindable]
      private var ac : ArrayCollection;
     
      private function onCreationComplete() : void
      {
        ac = new ArrayCollection();
       
        for (var i:int = 0; i < 25; i ++)
        {
          ac.addItem( UIDUtil.createUID() );
        }
      }
    ]]>
  </mx:Script>
 
  <mx:List width="100%" height="100%"
    dataProvider="{ ac }" />
 
</mx:Application>