EasyCFM.COM ColdFusion Forums / Flash Development / falsh website

   Reply to Discussion | New Discussion << previous  
Posted By Discussion Topic: falsh website

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

05-06-2007 @ 4:30 AM
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 109
Joined: Jan 2007

how do i design a fully functional website in flash 8 and also use coldfusion as a backend for database manupilation.

05-06-2007 @ 6:40 AM
Send P.M.
My Gravatar!
Powered by Gravatar
Posts: 717
Joined: Oct 2004

For flash to work with coldfusion you need to create cfcs that hold the functions that do the database calling. Usually a simple query. Once you have your cfcs and functions set up test to make sure that the cfc is good by calling it in the web browser of choice and add "?wsdl" to the end. So something like this:


Then in flash you will need to import the services required to make a connection and then call the connection as illustrated below.

import mx.services.WebService;
import mx.services.PendingCall;
import mx.services.Log;
function PopulateLists() {
     var myService = new WebService( "http://localhost:8500mysite/cfc/startContent.cfc?wsdl");
     var serviceCall:PendingCall = myService.myFunction();
     serviceCall.onResult = function(result) {
          if (result == "error in processing") {
          } else {
               mGrid.dataProvider = result;

This will call a cfc function with the name of myFunction and get the results from the query to return to a Grid in the flash app.
You can also pass varaibles to the cfc (cfarguments) by doing this in your code:

var serviceCall:PendingCall = myService.myFunction(variable1,variable2,etc);

You can populate lists, text fields, grids, images, etc by doing this. It's very simple and straight forward.


Website Designed and Developed by Pablo Varando.