EasyCFM.COM ColdFusion Forums / Flex Development / Flex Combobox and "Access of undefined property ..

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Flex Combobox and "Access of undefined property ..

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

falconseye
10-12-2009 @ 3:53 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

I am kind of puzzled and not sure how to tackle this issue: Got two comboxes with dataproviders. Also, I created a separate index.as in /as folder. I have these two functions:



In my .mxml page, I have :

          <mx:FormItem label="Property Code:" id="fi_propertyCode"  width="100%">
                <mx:ComboBox id="propertyCode"  width="50%" dataProvider="{qry_communites}" change="showPropertyCode()" />
              </mx:FormItem>
            
              <mx:FormItem label="Utility Type:" id="fi_utilityType" width="100%">
                  <mx:ComboBox id="utilityType"  width="50%" dataProvider="{qry_utilityTypes}" change="showUtilityType()" />
            </mx:FormItem>

and in my index.as, I have:



private function showPropertyCode():void {
    mx.controls.Alert.show(propertyCode.selectedItem.label, propertyCode.selectedItem.data);
}



private function showUtilityType():void {
    mx.controls.Alert.show(utilityType.selectedItem.label, utilityType.selectedItem.data);
}



I get an error saying

Access of undefined property utilityType.



The funny thing is I don't get this error for "propertyCode". Moreover, If I copy pasyte showUtilityType() function and put inside my .mxml page, I don't get this error either. Btw. I have :

<mx:Script>
        <![CDATA[
            include "../as/index.as";

      ....

</mx:Script>



in my .mxml page. What should I do? How can I get rid of this error? Why does Flex see propertyCode combobox but not utilityType combobox? I would rather keep index.as as it is. Thanks in advance.

http://www.fuzzysiberians.com

falconseye
10-13-2009 @ 1:29 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

I ended up getting rid of the external actionscript file and put all that code within the mxml page. At least, it works this way.

http://www.fuzzysiberians.com


Website Designed and Developed by Pablo Varando.