2 Replies Latest reply on May 21, 2009 11:23 AM by manofspirit

    All the xml and arrays are getting NULL Problem

    manofspirit Level 1

      Hello guys

       

      I am working on a project which uses xml loading, e4x and array manipulation extensively, and it was going good but now I got stuck on a strange problem.  Whole code was fine and application was working and responding in a desired way, but then mystourisly it stopped working and started to retun NULL values to almost all the actionscript (internal) Arrays and XML varibales.

      Now Whenever i load xml file and assign the loaded values to internal xml variables, internal values get only NULL instead of data.
      Same is the situation with Arrays, I created some components in mxml, and when i passed them to arrays by reference, code gets compiled successfully, but again Array has only null values [that code was working fine too]

      I am wondering if Adobe Flex did a silenced update or something similar and it is the result of that things !

       

      I am using Adobe Flex 3.2 with SDK 3.3 on windows Vista Ultimate.

       

      Please check this attached project, Import it and see if you face the same problem

      Thanks

       

       

       

      Link to Problem Project

      http://isolatedperson.googlepages.com/problemXperiment.zip

       

      Problem Screenshot

      http://isolatedperson.googlepages.com/xmlissue.JPG

        • 1. Re: All the xml and arrays are getting NULL Problem
          Gregory Lafrance Level 6

          Use HTTPService to load the data. You'll have fewer problems.

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application creationComplete="dataSvc.send();" 
            xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
               <mx:Script>
                    <![CDATA[
                      import mx.collections.XMLListCollection;
                      import mx.rpc.events.ResultEvent;
                      
                      [Bindable] private var xlc:XMLListCollection;
                    
                         private function loadXML(evt:ResultEvent):void{
                          xlc =  new XMLListCollection(evt.result.individual.@id as XMLList);
                         }
                         
                    ]]>
               </mx:Script>
               <mx:HTTPService resultFormat="e4x" result="loadXML(event)" url="alirazaTree.xml" id="dataSvc"/>
               <mx:ComboBox id="cbx" dataProvider="{xlc}"/>
          </mx:Application>