![]() |
![]() |
||||||
|
|||||||
| Tags: arraycollection, problem |
![]() |
|
|||
|
Hi all
I have a little problem with an array collection the thing is that Im working with httpservices and this bring you and xml file and i have no problem when im using this xml <object> <item> <id>1</id> <name>MOSTRADOR</name> </item> <item> <id>2</id> <name>CAJERA</name> </item> <item><id>3</id> <name>FINANZAS</name> </item> </object> but for example when im using <object> <item> <id>1</id> <name>info </name> </item> </object> when i assign the information to the ArrayCollection variable i don't know why the result of this is null im assigning this file like this mySubmenus = e.result.object.item as ArrayCollection; and this is the code of the httpservice <mx:HTTPService id="myService" url="http://mypage/bringInfo.php" showBusyCursor="true" result="showSuccess(event)" fault="showError(event)" /> anyone can help me on this one, how should i assign this file this xml well i hope anyone can help me regards |
| Sponsored Links |
|
|||
|
"cesaregb" <webforumsuser@macromedia.com> wrote in message news:g9f1e9$c49$1@forums.macromedia.com... > Hi all > > I have a little problem with an array collection > > the thing is that Im working with httpservices and this bring you and xml > file > and i have no problem when im using this xml > > <object> > <item> > <id>1</id> > <name>MOSTRADOR</name> > </item> > <item> > <id>2</id> > <name>CAJERA</name> > </item> > <item><id>3</id> > <name>FINANZAS</name> > </item> > </object> > > but for example when im using > > <object> > <item> > <id>1</id> > <name>info </name> > </item> > </object> > > when i assign the information to the ArrayCollection variable i don't know > why > the result of this is null > > im assigning this file like this > mySubmenus = e.result.object.item as ArrayCollection; I think e.result will already contain the object level, if the format is e4X. If you're using the default Object format, I'm not so sure. I think when it comes back as Object and there's only one Object, for some reason it is null. You could try switching your result format to e4x and then use something like this: var myXMLList:XMLList=e.result.child('item'); var myXMLListCollection:XMLListCollection=new XMLListCollection(myXMLList); mySubmenus - new ArrayCollection(myXMLListCollection.toArray()); Though you might be better off just using the XMLListCollection. HTH; Amy |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise