开发者

Flash and database integration

I recently had a couple of flash products to do, which basically were a clients for some database (online games, movie players). In all of them I used PHP + MySQL as the server database and then made the flash client application work with those databases.

This was ok, but I'm somewhat interested if there is some other choice except PHP + SQL database for开发者_如何转开发 the server backend, which would be, like, more Flash-oriented or something (easier to deploy, etc).

Does someone know what can I use for that?

Thank you.


Any server script & database will work with flash. The URLLoader works with any HTTP request. All it's doing is making a request to the server for data.

IMHO PHP + MySQL is the way to go, but you could choose Python or Perl or ASP.net, with Oracle, or DBase, or whatever.

Flash has a nice implementation of XML, so passing data via XML works great. If your data doesn't change very much/often (or even if it does) you can generate static XML files for the flash player to hit. If it's content that changes often, then you'll want to request data directly from the server script.

Just make sure that you send the correct mime type from the server, so that the flash script will know what to do with the data.


I've personally really liked using PHP and MySQL as the backend for a lot of the mom and pop applications/websites I've done, and it serves it's purpose. XML is after all pretty easy to read so debugging is generally not too troublesome.

I think what you're after though is AMF (actionscript message format) this is the serialized version (if you're unfamiliar with the term basically the binary form of the object) of plain old actionscript objects, you can use BlazeDS (free from Adobe) as a component to the server. In big projects I've used some sort of J2EE server (like Websphere or Apache Tomcat), BlazeDS, Spring, and iBatis (Teradata DB sitting behind it but who cares :) ) with some pretty awesome success (setting up this sort of environment isn't trivial though... taken piece by piece it can be done and using build tools like maven makes life easier). If you've got the gut for it I would recommend this route: http://code.google.com/p/maven-blazeds-spring-archetype/

Alternatively check out amfphp a php backend that supports AMF or other AMF libraries for your language of choice, it's all very decoupled and each piece can be chosen based on what suits your needs best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜