1 Reply Latest reply on Aug 25, 2010 10:00 PM by BhaskerChari

    Get variable from a Component

    GeorgeWS Level 1

      I have a main .mxml There is a filterFunction at the main. I want to retrieve a variable from a component. The variable should come from a textBox that changes when an item is clicked on from a DG in another component. So my statement is like:


      public function processFilter(item:Object):Boolean {


      if (myText.text == item.Proxy || item.Proxy =="") {

      return true;

      } else {

      return false;




      The myText Is in a differnet component named DetailsComponent.

      So I thought I could just add that to the myText like :  DetailsComponent.myText.text


      But No go





        • 1. Re: Get variable from a Component
          BhaskerChari Level 4

          Hi George,


          Do you have the DetailsComponent placed in the main mxml file..???


          If you have placed your component in main mxml file by giving an id then...you could access the myText as below...


          //In main mxml file

          <comp:DetailsComponent id="myDtlsComp" />

          // To get the myText text property you can access it as


          var myText:String = myDtlsComp.myText.text;