7 Replies Latest reply on Jan 24, 2010 6:31 PM by flexy8

    FB4 doesn't tell me what's wrong with my code. Not even letting me trace().

    flexy8 Level 1

      Attached is my code that run well but the problem is, I know there is something wrong with my code since the dropdown list isn't populated unlike the textarea. Doesn't even put anything on the output panel when i do trace()-ing.

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

      xmlns:s="library://ns.adobe.com/flex/spark"

      xmlns:mx="library://ns.adobe.com/flex/halo"

      creationComplete="application1_initializeHandler(event)">

      <s:layout>

      <s:BasicLayout/>

      </s:layout>

      <fx:Script>

      <![CDATA[

      import mx.events.FlexEvent;

       

       

      protected function application1_initializeHandler(event:FlexEvent):void

      {

      var xml:XML;

      var xmlLoader:URLLoader = new URLLoader();

      xmlLoader.load(new URLRequest('data/places.xml'));

      xmlLoader.addEventListener(

      Event.COMPLETE,

      function (e:Event):void {

      xml = new XML(e.target.data);

      trace(xml.place[0].barangay.descendants().toXMLString());

      for each (var pro:Object in xml.places.place)

      {

      dp.dataProvider.addItem({province:pro.province});

      }

      ta.text = xml.place[0].barangay.descendants().toXMLString();

       

      }

      );

      }

       

      ]]>

      </fx:Script>

       

      <s:DropDownList id="dp"

      labelField="province"

      width="197"

      x="10" y="10"/>

      <s:TextArea x="198" y="186" id="ta" editable="true"/>

      </s:Application>