Tuesday, April 30, 2002

Example : loading data from a data base into Flash MX with Flash Remoting and ServerSide ActionScript

First, view the following tutorial / example:

Example : loading data from a data base into Flash MX with Flash Remoting and CF MX

we will use the same Flash MX code in that example, and just change the server side code.

Instead of creating a ColdFusion component called DbTest.cfc, create a file called DbTest.asr. Make sure that you rename the DbTest.cfc to something else if you did the first tutorial.

Add the following to the DbTest.asr file:

function getData()
{
 /**create an object to hold our parameters**/
 var queryData = new Object();
 
 /**set the DSN name pointing to the database**/
 queryData.datasource = "CompanyInfo";
 /**setup our SQL Query**/
 queryData.sql = "select * from Employee";
 /**Execute the query, and store the results in a variable**/
 var rs = CF.query(queryData);
 
 /**return the RecordSet to flash**/
 return rs;
}

You don't need to change anything in the Flash code. Create the Flash movie according to the directions in the tutorial and test your movie.

10:11:17 PM    comment []  Google It!  

© Copyright 2003 Mike Chambers.
 
April 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Mar   May


Macromedia MX

Resources

Flash MX

Aggregators

Books

Click here to visit the Radio UserLand website.

Subscribe to "Examples" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.