
www.outthebox.net
www.jasonmperry.com
As Macromedia moves Flash from an animation tool to a complex IDE for developing Rich Internet Applications, database connectivity and server-side processing are becoming more and more important. One way developers can interact with data in Flash is through Macromedia Flash Remoting, a middleware application through which Flash applications can access SQL and OLE databases using J2EE, .NET, ColdFusion, or XML and web services. After accessing this data, developers can manipulate the database results using a RecordSet, or they can bind this data directly to a Flash User Interface (UI) component like the DataGrid or ListBox components.
Flash Remoting for .NET lets Flash applications take advantage of the extensive ADO.NET database connectivity library. This means Flash applications can directly bind to a DataSet object and gain from the ADO.NET library's features.
Many web-based application languages that came before Flash, like ActiveX and Java Applets, have similar abilities. However, some advantages of Flash include its large design following, its speed, and its support for multiple back-end technologies.
In this article, you will learn how to use Flash Remoting to create database connections on a .NET web server with Flash Remoting through the creation of a Flash-based SQL query tool (see Figure 1). I will also provide a basic overview of binding database records to Flash UI components. You can also view a working example of this application at www.jasonmperry.com. For background on using Flash Remoting with ASP.NET, read my other Developer Center article, Introduction to Flash Remoting with .NET or my article on the O'Reilly website, Consuming Amazon with Flash Remoting.
Figure 1. SQL Query tool developed with Flash MX, Flash Remoting, and ASP.NET
The Flash SQL Query tool (see Figure 1) provides an interface for running SQL commands against a Microsoft Access database. The resulting data result is displayed using Macromedia’s DataGrid component.
This article explores database connectivity for Flash applications using ADO.NET and Flash Remoting. To complete this tutorial, you should have an intermediate knowledge of ActionScript and ASP.NET. You also need the following software installed:
Note: This tutorial uses the Northwind database that installs with Microsoft Access. It is not included in the ZIP file above, however, you can find it on your local machine or download it from Jason Michael Perry's website at www.jasonmperry.com/downloads/northwind.zip.