Hello all,

This is very simple example, I want to get child from click method through 
rawChildren but giving null values.

Below is the implementation, please help. I need to add List at runtime.


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";  
creationComplete="application1_creationCompleteHandler(event)"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" 
minHeight="600">

      <fx:Script>
            <![CDATA[
                  import mx.controls.Alert;
                  import mx.controls.List;
                  import mx.events.FlexEvent;
                  protected var wBox:DisplayObject;
                  var lstControl:List;
                  protected function b1_clickHandler(event:MouseEvent):void
                  {
                        wBox=vbox.rawChildren.getChildByName("lstControl");
                        Alert.show(wBox+":::::::::::;");
                  }

                  protected function 
application1_creationCompleteHandler(event:FlexEvent):void
                  {

                        lstControl= new List();
                        vbox.addChild(lstControl);
                        //vbox.addChild();
                  }

            ]]>
      </fx:Script>

      <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here 
-->
      </fx:Declarations>
      <mx:VBox id="vbox" creationPolicy="All">
            <s:Button id="b1" click="b1_clickHandler(event)">

            </s:Button>
            <s:Button id="b2">

            </s:Button>


      </mx:VBox>
</s:Application>


Thanks,
Seema




===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

Reply via email to