One primary reason for the dearth of full examples of Flex client <-> server data flow is that Flex is just too darn flexible. There are just sooo many options.
These include data model(XML, ArrayCollection,XMLListCOllection, VOs), RPC protocol(HTTPService, WebService,RemoteObject) and Data Service (LCDS and BlazeDS) and third party solutions (WebOrb, Fluorine), reasltFormat(e4x, object, text), contentType(xml, name=value), server platforms (Windows, linux, solaris), Web servers(IIS,Apache), server development platform(.net, PHP, java, ...). The good news is that if you look, you will probably find at least partial examples of most any path through that morass. And for general flex development, there are a huge number of examples available, at all levels of complexity. Just not all in one place. Start with the Adobe site, especially Getting Started: http://learn.adobe.com/wiki/display/Flex/Get+oriented+to+Flex. Also the example in Flex Builder's Start Page. And below is a list I compiled of resources. It is pretty out of date, but might still be useful, if overwhelming. Tracy http://www.flex.org/ http://www.adobe.com/devnet/flex/ <http://www.adobe.com/devnet/flex/> http://www.adobe.com/products/flex/productinfo/faq/ <http://www.adobe.com/products/flex/productinfo/faq/> http://www.adobe.com/cfusion/communityengine/index.cfm?event=homepage&pr <http://www.adobe.com/cfusion/communityengine/index.cfm?event=homepage&p r> oductId=2 http://blogs.adobe.com/ <http://blogs.adobe.com/> http://weblogs.macromedia.com/mxna/ <http://weblogs.macromedia.com/mxna/> http://labs.adobe.com/ <http://labs.adobe.com/> http://labs.adobe.com/community/ <http://labs.adobe.com/community/> http://www.adobe.com/cfusion/exchange/index.cfm#loc=en_us&view=sn610&vie wName=Adobe%20Exchange&avm=1 http://blogs.adobe.com/flexdoc/ <http://blogs.adobe.com/flexdoc/> http://nondocs.blogspot.com/2007/04/metadatapercentproxy.html <http://nondocs.blogspot.com/2007/04/metadatapercentproxy.html> Other: http://www.cflex.net/ <http://www.cflex.net/> http://www.searchcoders.com/flex/ <http://www.searchcoders.com/flex/> http://www.flexination.info <http://www.flexination.info> http://flexibleexperiments.wordpress.com/2007/03/14/flex-20-primitive-ex <http://flexibleexperiments.wordpress.com/2007/03/14/flex-20-primitive-e x> plorer/ http://www.scalenine.com <http://www.scalenine.com> http://www.flexcursion.com <http://www.flexcursion.com> http://www.theflexshow.com <http://www.theflexshow.com> http://www.JeffryHouser.com <http://www.JeffryHouser.com> http://blog.digitalbackcountry.com/ <http://blog.digitalbackcountry.com/> . http://code.google.com/p/flexlib/ <http://code.google.com/p/flexlib/> http://flexbox.mrinalwadhwa.com/ <http://flexbox.mrinalwadhwa.com/> http://dougmccune.com/blog/ <http://dougmccune.com/blog/> http://www.quietlyscheming.com/blog/ <http://www.quietlyscheming.com/blog/> http://www.everythingflex.com <http://www.everythingflex.com> http://www.waldosmeets.com/ <http://www.waldosmeets.com/> http://www.jessewarden.com/ <http://www.jessewarden.com/> http://www.cbetta.com/blog/ <http://www.cbetta.com/blog/> http://www.cynergytv.com/ <http://www.cynergytv.com/> http://www.flexdaddy.info/ <http://www.flexdaddy.info/> http://www.richinternet.de/blog/ <http://www.richinternet.de/blog/> http://www.brightworks.com/technology/overview.html <http://www.brightworks.com/technology/overview.html> http://www.crossdomainxml.org/ <http://www.crossdomainxml.org/> http://flexsearch.org/ <http://flexsearch.org/> http://labs.flexcoders.nl/ <http://labs.flexcoders.nl/> Flex style Explorer: http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplo rer.html Documentation: http://www.adobe.com/support/documentation/en/flex/ <http://www.adobe.com/support/documentation/en/flex/> http://livedocs.macromedia.com/flex/2/ <http://livedocs.macromedia.com/flex/2/> http://www.adobe.com/cfusion/knowledgebase/index.cfm <http://www.adobe.com/cfusion/knowledgebase/index.cfm> Lists: http://www.adobe.com/cfusion/webforums/forum/index.cfm?forumid=60 <http://www.adobe.com/cfusion/webforums/forum/index.cfm?forumid=60> http://groups.yahoo.com/group/flexcoders/ <http://groups.yahoo.com/group/flexcoders/> http://groups.yahoo.com/group/flexcomponents/ <http://groups.yahoo.com/group/flexcomponents/> Bugs/enhancement requests: http://bugs.adobe.com <http://bugs.adobe.com/jira/browse/SDK-7698> ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of mr_delphi_developer Sent: Friday, May 09, 2008 3:11 PM To: [email protected] Subject: [flexcoders] Re: Using XMLList as dataprovider to DataGrid and Adding rows 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] <mailto:flexcoders%40yahoogroups.com> , "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:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of mr_delphi_developer > Sent: Friday, May 09, 2008 10:42 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Using XMLList as dataprovider to DataGrid and > Adding rows > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> <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"); > } > } >

