4 Replies Latest reply on Sep 21, 2009 5:44 AM by lee704

    How to access (call) variables from multiple components

    lee704 Level 1

      I have what I think is a basic task, but I cant seem to get it to work.  I have a Flex project with one application.  In addition to the one application, I have many components that are used in the application.  These components vary from simple (a ComboBox) to complex (many sub-components).  What I need to do is define a viable in one component and access it in another component.  I can't seem to do this.  Below is an example of how I think it should be:

       

      Component1

       

      <mx:Script>
             <![CDATA[
        
              [Bindable]
              private var userID:int=0;

       

             ]]>
      </mx:Script>

       

       

       

      Component2

       

      <mx:TextInput  text="{Component1.userID}"/>

       

       

      Any help you can provide would be beneficial.

       

      Lee