4 Replies Latest reply on May 28, 2012 5:43 PM by 56231

    arraycollection only works when there is more than one item.

    56231 Level 1

      Flex 4.6.   XML is generated by php.












      When the xml has more than one row of (pic_no, pic, tex); For Example:



      <tex>some text</tex>



      <tex>some text2</tex>

      The dataGrid and Alert.show() fills with this info. But if there is just one row of (pic_no, pic, tex), the dataGrid remains empty and Alert.show() doesn't even display.


      Is there something still missing from my code? Does just one item in ArrayCollection need to be handled differently? Thanks.


      import mx.collections.ArrayCollection;

      [Bindable] private var img:ArrayCollection;


      private function getImgResult(event:ResultEvent):void {

               img = event.result.imgtex.image;

               mx.controls.Alert.show("img=" + img);