flash builder - what dataprovider in flex (aside from ArrayCollection) will work for single, non-repeating XML nodes? -
I had asked this question before but the answer is not found. When I receive a retrieve XML that only There is 1 node (no repeated node) from a PHP page and I try to store it in an arrackchlank. -When I have more than 1 "name" nodes ... I did not get any errors.
TypeError: Error # 1034: Type Forced Failed: "XXXXXX" can not be converted to mx.collections .ArrayCollection.
This error occurs in the form of a line of code:
myList = e.result.list.name;
I am using this ArrayCollection as a datapriver for a component - is there any option that I would like to do with that single and repeated nodes as a dataprovider Can work? thank you in advanced!
code:
[bindable] personal work myList: ArrayCollection = new ArrayCollection (); Private Function getList (E: Event): Zero {var getStudyLounges service: HTTPService = New HTTPService (); GetStuffService.url = "website.com/asdf.php"; GetStuffService.addEventListener (ResultEvent.RESULT, onGetList); GetStuffService.send (); } Private Event onGetList (e: ResultEvent): zero {myList = e.result.list.name; }
XMLListCollection
Do personalized myList: XMLListCollection = new XMLListCollection ();
Private function getList (E: Event): Something like this (this is in Psuedo code): : Zero {var getStudyLounges service: HTTPService = New HTTPService ( ); GetStuffService.url = "website.com/asdf.php"; GetStuffService.addEventListener (ResultEvent.RESULT, onGetList); GetStuffService.send (); } Private function onGetList (e: ResultEvent): Zero {var result: XML = e.result as XML; MyList.source = Results; }
Comments
Post a Comment