Flash and Databases

When creating Flash elements, connecting it to a database isn’t the first thing that comes to mind. It is possible though, as long as you or someone on your team has the ability to also code in a language like PHP or ColdFusion.

Flash really only has one way to call a programmed ColdFusion or PHP page while also sending it any data it would use. This is with the loadVariables command in actionscript. Using this actionscript command you can send over an unlimited amount of information for the ColdFusion or PHP page to use and do what it wants with it. Typically, this would mean adding this information to a database for future use, but it could do many other things.

I have been able to use this many times here at DDA. My first use of this function was to send a bunch of form information to a ColdFusion page, which in turn put that information into an email and sent it out. I have also added a hit tracker that stores the number of views and dates and times that the views occurred for a Flash movie. Lately I have been using it for image resizing and storage. I have the user uploading an image and then the ColdFusion resizes the image and stores it on the web in its own folder. I can then use the newly uploaded image in the Flash element again in its new smaller size.

The possibilities of what you can do with Flash are extended. You hold the power of ColdFusion and PHP in your hands to make some really impressive and versatile applications.