House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / Adobe Flex

passing a variable value from a component to the main application

Author:
mojtaba tabatabaie
11/26/2010 03:28 PM

hi , I have a flex application with one component . in that component I have defined a variable named "correctUsername" . after I click a button in the component I give a value to the correctUsername variable . and I want to have that value in my main application . but seems I can't do it in a way I'm doing it . the code is as below : my component is named "signIn" ------------------------- ..... <!-- signIn component --> <fx:script>    public var correctUsername:String;    .....    public function submitLogin():void{       correctUsername = "ok";    }    ... </fx:script> ..... <s:Button label="myBtn" click="submitLogin()"/> --------------------------- --------------------------- my main application: .... <!-- my main application --> <fx:script>    public var testSign:signIn;    public funtion btnClick():void{       testSign = new signIn();       testInput.text = testSign.correctUsername;    } </fx:script> .... <components:signIn id="myComponent"/> <s:TextInput id="testInput"/> <s:Button label="btn" click="btnClick()"/> ------------------------------------------ ------------------------------------------ anyone knows where the problem is? the thing that has mixed me up is that if I give the value of correctUsername variable in my component outside of any funtions it works fine and my main application shows the value correctly , but if I give it value inside any functions the main application doesn't show the value . I'll be appreciated if you can help me with this .


Search flex

June 18, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
             1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30             

Designer, Developer and mobile workflow conference