Ist error in this piece of code
[Bindable]
private var myData:ArrayCollection;
private function resultHandler(event:ResultEvent):void
{
myData = event.result.img.src;
}
you forget to make the instance of the arrycollection
Second you didn't parse event.result.img.src into arraycollection
The correct code is
[Bindable]
private var myData:ArrayCollection;
private function resultHandler(event:ResultEvent):void
{
myData = new ArrayCollection();
myData = event.result.img.src as ArrayCollection;
}
Second there is no method like getListItems which you are trying to
access.
Instead you should use getItemAt(indexValue);
HTH
Thanks,
Shaleen Jain
http://shaleenjain.blogspot.com
On Apr 6, 5:21 pm, Ravi Mishra <[email protected]> wrote:
> set a breakpoint on the resultHandler function and check what
> event.result is returning. This will help you.
>
> -Ravi
>
> On Apr 6, 4:21 pm, KKH <[email protected]> wrote:
>
> > Hi Friends,
>
> > I am new comer in flex. i have one dought . how to get the list of
> > value and dispaly it from the xml file. plz verify following prg
> > correct or not
>
> > this is Mxml:
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> > backgroundGradientColors="[0xFFFFFF, 0xAAAAAA]"
> > horizontalAlign="left"
> > verticalGap="15" horizontalGap="15" initialize="myService.send()">
> > <mx:Script>
> > <![CDATA[
> > import mx.collections.ArrayCollection;
> > import mx.rpc.events.ResultEvent;
>
> > [Bindable]
> > private var myData:ArrayCollection;
>
> > private function resultHandler(event:ResultEvent):void
> > {
> > myData = event.result.img.src;
> > }
>
> > ]]>
> > </mx:Script>
>
> > <mx:HTTPService id="myService" url="assets/img_path.xml"
> > result="resultHandler(event)"/>
>
> > <mx:Text id="something" text="{myData.getListItems.path}"
> > enabled="true" visible="true"/>
>
> > <mx:Image id="myimg" source="{myData.getListItems.path}" />
>
> > <!-- <mx:Text id="something" text="{myData.getItemAt
> > (0).path}"
> > enabled="true" visible="true"/>
>
> > <mx:Image id="myimg1" source="{myData.getItemAt(0).path}" /> --
>
> > </mx:Application>
>
> > Xml:
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <img>
> > <src>
> > <path>assets/1.png</path>
> > </src>
> > <src>
> > <path>assets/2.png</path>
> > </src>
> > <src>
> > <path>assets/3.png</path>
> > </src>
> > </img>
>
> > Thanks & Regards
> > KKH
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---