Topic: can't seem to get any answers on established forums....

I want to integrate Flash with database stuff. But not sure where to start.

If I can avoid it I don

Re: can't seem to get any answers on established forums....

The most straightforward way to integrate Flash and databases would probably be to have a server-side script spit out XML that your Flash movie can import. I don't know how the ActionScript code for that would go since I don't really do Flash, but the XML bit isn't too difficult if you already know a server-side language or want to do it in Rails.

vinnie - rails forum admin

Re: can't seem to get any answers on established forums....

thanks I'll look into it.

I'm guessing flash replaces javascript in a typical RoR arrangement. Is it also a reasonable to say javascript calls code in the RoR framework? Sorry if seems dumb just trying save myself hours of frustration.

Re: can't seem to get any answers on established forums....

Actually, XML would replace HTML/views in the typical RoR arrangement, and the Flash frontend would be completely external (other than possibly being hosted at the same place as your RoR app).

vinnie - rails forum admin

Re: can't seem to get any answers on established forums....

thanks for all your help vinnie

Re: can't seem to get any answers on established forums....

You can download XPath libraries for flash from www.xfactorstudio.com that make dealing with XML in flash much easier, though it does add a small bit of overhead.

Re: can't seem to get any answers on established forums....

If your starting out I'd recommend you check out Cake/AMFPHP. Cakephp is a PHP framework based on Rails http://www.cakephp.org/. AMFPHP http://www.amfphp.org/ is a Flash Remoting Gateway, and can be used as a plugin for Cake.

Re: can't seem to get any answers on established forums....

This isn't something I've tried but wouldn't the View still produce the HTML and reference the Flash while an action would produce the XML?  I've seen Flash take an XML file from a URL so doesn't that URL just become an action which is talking to the database?  Sounds to me like it could be done quite neatly within the RoR framework. 

Makes a change for someone to be using Flash instead of creating a couple of thousand lines of Javascript to do the same things smile

Re: can't seem to get any answers on established forums....

allen wrote:

This isn't something I've tried but wouldn't the View still produce the HTML and reference the Flash while an action would produce the XML?  I've seen Flash take an XML file from a URL so doesn't that URL just become an action which is talking to the database?  Sounds to me like it could be done quite neatly within the RoR framework.

Yeah pretty much. But typically XML is generated with Builder in a .rxml file under Rails. It can be done in the controller if you have a simple structure and use an ActiveRecord object's to_xml method, as long as your Flash movie can work with that.

vinnie - rails forum admin