You can set the dataprovider of a DataGrid with a result set from MySQL or similar.

I have an experiment with AS2 + AMFPHP + datagrid at home, so guessing that AS3 is similar - will try and find it later if you are interested.

Although you can't do "data-binding" in the {Flex} way without the framework - that's an implementation of the observer pattern, so you could roll your own if you wanted. You can use the "Watcher" stuff that comes with the framework for a pure AS3 implementation - can't remember where it is, but look in the doc's - you can set up property watchers in Flex AS3 which you respond to (bit like registering listeners...)

Glen

Sidney de Koning wrote:
Nice one guys, thanks for the response.
Since i'm not at all into Flex, in the video he talks about binding (and mapping them to ValueObjects).
My question is can i do this with pure AS3?

Cheers,

Sid

On Mar 30, 2009, at 4:23 PM, Glen Pike wrote:

AMFPHP did this really well with result sets too - straight out of the box like CF.

Muzak wrote:
For database type data, Array of Objects.
Forget about XML.

With Coldfusion (and remoting) you can grab a database query result and just send that straight to Flash/Flex and it will be transformed into an Array of Objects automatically.

In CF it's as simple as:

<cfset var rsResult="" />
<cfquery name="rsResult" other stuff..>
SELECT * FROM table_name
</cfquery>
<cfreturn rsResult />

Seems they're still working on mapping PHP to AS objects:
http://wadearnold.com/blog/?p=54
Allthough, the article is from sept 2008, so it may have been implemented by now.

So if class mappings are implemented (still have to take Zend AMF for a spin) then that's the *best* option, but probably not the *fastest*. At least in Coldfusion transforming plain vanilla objects into typed objects slows things down (especially with lots of data).

regards,
Muzak

----- Original Message ----- From: "Sidney de Koning" <sid...@funky-monkey.nl>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Monday, March 30, 2009 12:05 PM
Subject: [Flashcoders] Best data type for Zend AMF


Hi List,

I'm using Zend AMF, and i'd like to know what is the best way and fastest to transfer data. For instance; do i create an array from database data in PHP and send it to flash? Or do i formatted array data from a database to xml and send that to flash? Which is the fastest? And more specifically; what datatype is the fastest.

Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to