You know, there isn't enough documentation on how to do this type of thing, even on the Adobe sight. I am finding it difficult to find any Flex3 examples on how to do things with the exception of the elementary stuff such as 'Hello World'.
I'm currently looking at AMFPHP to see if it will help me figure this thing out and do it with the least amount of headaches. Know where to get any Flex3+AMFPHP examples? The examples for DL at SourceForge don't have any Flex code. Thanks for looking into this. --- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > You can get back the plain Array by doing: > > var aRoster:Array = rosterInfo.source; > > Now, what you are doing is a bit odd. You are looping over an XMLList > to build an ArrayCollection of XML nodes. Do you have a reason for > this, instead of just using XMLListCollection? You would not need to > loop to do this. > > > > There are performance benefits to building an ArrayCollection from XML, > but it requires strongly typed objects to get the benefit, and using XML > will not help with that. > > > > If you are asking how to update a database from a Flex client, that is a > very large and general subject. You'd best ask it under its own > subject. > > > > But the method you choose to do this will impact the way you handle the > data in Flex (ArrayCollection vs XMLListCollection vs XML), so you > should make those choices before you go much further with your client > implementation. > > > > Tracy > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of mr_delphi_developer > Sent: Friday, May 09, 2008 10:42 AM > To: [email protected] > Subject: [flexcoders] Re: Using XMLList as dataprovider to DataGrid and > Adding rows > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > , "Tracy Spratt" <tspratt@> wrote: > > > > Right. That's too much code to analyze, but generally, if you plan > > to update a dataProvider programatically, do not use XMLList or > > Array,as they do not dispatch the necessary events to update the > > UI. With XML, use XMLListCollection, then use that api to update > > the data. All should work as expected. > > > > > > > > Tracy > > > > > <SNIP> > > OK here is the modification, I added three fields and another > button to allow adding of players to the ArrayCollection. > > This works exactly as needed but how do I send changes to the > ArrayCollection back to a PHP script so I may modify my DB? > If I send the ArrayCollection, how will it be seen by the PHP > script, as an array? > > [Bindable] > private var rosterInfo:ArrayCollection = new ArrayCollection(); > > public function handleXML(event:ResultEvent):void > { > // Convert XML response to ArrayCollection > for each(var s:XML in event.result.option){ > rosterInfo.addItem(s); > } > } > > <snip> > > // This function adds rows to the ArrayCollection, clears the > // entry controls and scrolls the newest entry into view. > public function addPlayer():void > { > if ((player_name.text.length > 0) || > (jersey_.text.length > 0)) || > (age_.text.length > 0)) > { > (RosterList.dataProvider as ArrayCollection).addItem( > {playerid: 0, > playername: player_name.text, > jersey: jersey_.text, > age: age_.text} > ); > player_name.text = ''; > jersey_.text = ''; > age_.text = ''; > RosterList.selectedIndex = rosterInfo.length; > RosterList.scrollToIndex(RosterList.selectedIndex); > } else { > Alert.show("Players may be entered with blank values"); > } > } >

