find a component with his id ? (ex find a Label in a Panel with the Label's id)


hello, need find children component id (so without getchildat ou byname methods)

 

ex :
<mx:panel id="panel1" x="10" y="10" title="panel 1" width="400" height="300">     
<mx:label id="label1" x="15" y="15" text="label 1 dans panel 1" />

<mx:panel id="panel2" x="70" y="50" title="panel 2 ds panel 1" width="100" height="50">
<mx:label id="label2" x="25" y="25" text="label 2 dans panel 2" />                    
</mx:panel>                    
</mx:panel>

 

with id=label2 or id=panel2 i have the label or panel, without having in children of children
because there 1 single id in application think it's possible, don't find how

 

think's in advance ideas ! smile.gif

 

dave

in application tag, add listener creation complete:

 

<mx:application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationcomplete="creationcompletehandler(event)"
    layout="vertical">

 

 

 

 

start script block , delcare new function like:

 

<mx:script>
        <![cdata[
           
            private function creationcompletehandler(event:event) : void {
                this.panel2.title = "new title panel 2";
                this.label2.text = "label2 text changed";
            }
           
        ]]>
    </mx:script>

 

 

so, see can accees these component ids. you're looking for?

 

atta



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Help with codes to add 1 more shift register and add more to matrix LED

tcp client

Can't read sms using Thinker A7 communicate with Arduino