Flash Remoting with ColdFusion Components
Takeaway: Flash Remoting makes it easy to use dynamic data in your Flash applications. Here's everything you need to know to use Flash Remoting with ColdFusion Components.
Flash Remoting takes some of the pain out of connecting Flash movies to dynamic content via ColdFusion. This article offers a complete demonstration of using Flash Remoting with ColdFusion Components.
The necessary tools
The following items are needed for the examples in this article:
- · Flash Remoting Components—Download Flash Remoting Components.
- · ColdFusion MX—A trial single-user version is available for download.
- · Flash MX—A trial version is available for download.
- · Microsoft Access—The simple database used for this demonstration is in .mdb format (Access), but any database will do as long as your table has the same name and field names as the one in this demonstration (Datasource name: flash_cf, table name: siteContent).
- · The demonstration files—Download the files used in this demonstration.
There are five steps for integrating Flash Remoting with ColdFusion Components.
Step 1: The data source
Open the Access database (from the downloaded .zip file) that accompanies this article and register in ColdFusion MX Administrator. You’ll notice a table named siteContent. Inside siteContent there are four fields: pageID, pageTitle, pageText, and pageLink. Figure A shows a snapshot of the Access database.
| Figure A |
![]() |
| Snapshot of Access database |
Step 2: Install Flash Remoting Components
Flash Remoting Components allow Flash to talk to ColdFusion and vice versa. A simple breakdown and installation instructions can be found at Macromedia’s Web site.
Step 3: The ColdFusion Component
Access the ColdFusion Component (CFC) from the .zip file you downloaded (Flash_CF.cfc) and view the source. ColdFusion’s new CFCs are self documenting, meaning they can automatically share information about their methods and properties. Basically, CFCs are collections of functions called methods. They can have as many methods as you care to define. Instead of attributes (used in custom tags), CFCs use arguments that assume the arguments’ scope when they are called through methods.
We’re going to use a CFC to query our Access database and display the data in Flash.
First, take a look at the CFC. Open Flash_CF.cfc and you’ll notice a simple method called getPageAll. The method getPageAll contains a <cfquery> called Everything that selects all the fields in table siteContent of datasource Flash_CF. The method getPageAll will return this query object to the Flash MX movie via Flash Remoting.
Since many CFCs can be grouped together (packaged), it’s generally a good idea to save them in their own directory. Make sure Flash_CF.cfc is in a directory called Cfc.
Step 4: The Flash interface
Open flash_cf.fla from the downloaded .zip file in Flash MX and you’ll see four layers: actionscript, dynamic content, layout, and background (Figure B). Click in the actionscript layer and open the Actions Panel.
| Figure B |
![]() |
| Sample Flash interface |
Connect to Flash Remoting Services. The code in Listing A connects to Flash_CF.cfc and exposes all of its methods.
Populate the interface with data. On the dynamic content layer, you’ll find the textboxes site_title, Instancename_0, and site_link. We’ll populate with data with the actionscript function presented in Listing B.
You’ll notice that the textbox site_link will contain data that is formatted in HTML. This is one way you can link to Web sites from Flash. Click on the site_link textbox and you’ll see that the HTML formatting button is selected.
Step 5: Test your application
The final step is to test the application. You should publish the Flash movie and watch the simple Flash interface bring in data from the Access database via the CFC. Figure C shows a snapshot of the Flash movie.
| Figure C |
![]() |
| Sample Flash movie snapshot |
Print/View all Posts Comments on this article
|
|
|
|
|
|
|
|
|
|
|
|
White Papers, Webcasts, and Downloads
- July 7th: The Virtual Presenter's Series: Start Right! Design Right!P resent Right! Citrix Online Presenting online is a completely different ballgame from presenting in ... Download Now
- The Impact of Virtualization Software on Operating Environments VMware Today's use of virtualization technology allows IT professionals to ... Download Now
- Invest in Smarter Collaboration - Early Benefits of Enterprise Social Software IBM Join industry leaders and experts on an interactive panel as they discuss ... Download Now
- Tuning Oracle on Windows for Maximum Performance on PowerEdge Servers Dell Tuning is the art and science of modifying and reconfiguring your system ... Download Now
- Trend Micro Email Encryption Client Free Download Trend Micro Trend Micro Email Encryption Client is a software plug-in for popular ... Download Now
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET




