There is a new tutorial on Server Side ActionScript at Macromedia.com. Here is the description:
Building a Database Query Application with Server-Side ActionScript
In this module, you can learn how to build an application that searches a database using parameters provided by the user and displays the results in a rich Macromedia Flash user interface. It demonstrates two key features of ColdFusion MX: the built-in Macromedia Flash Remoting service and new support for Server-side ActionScript.
I have been seeing a lot of questions about support for PHP with Flash Remoting. Currently, Flash Remoting doesn’t support PHP. As far as future support, we haven’t made any announcements concerning this, but we will be making some more announcements related to Flash Remoting in the near future.
Hope that helps…
This will be old news for some, but it is so useful i thought i would post it here. If you need some JavaScript code to do Flash player version detection, check out the the Moock FPI (Flash Player Inspector) that Colin Moock has put together. This is the best JavaScript Flash detection code I have seen.
Note : I am planning to integrate it into my site, but had some problems with Radio inserting HTML markup into my JavaScript. If anyone has any solutions, post them in the comments.
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.
If you are playing around with calling web services from Flash Remoting or ColdFusion MX, you have to pass all parameters to the web service even if they are not required.
From what i understand, this is an issue with the Axis code that CFMX uses for communicating with web services.
Below is sample code that shows how to load data from a data base from Flash MX using Flash Remoting and ColdFusion components.
Download and install the ColdFusion MX preview release.
Download and install the Flash Remoting Addons for Flash MX.
You can download the files here.
First create a new ColdFusion component, name it DbTest.cfc and save it in wwwroot\com\macromedia\dbtest
Here is the component code:
<cfcomponent>
<cffunction name="getData" access="remote" returntype="query">
<!- CompanyInfo is a DSN name for an example DB that CFMX sets up by default ->
<cfquery datasource="CompanyInfo" name="result">
select * from Employee
</cfquery>
<cfreturn result />
</cffunction>
</cfcomponent>
Open Flash, and place a Combo Box component on the stage, and give it an instance name of “dataBox”
add the following ActionScript to the first frame of the Flash movie:
This is an addendum to the following article: Getting Started with ColdFusion MX and Flash Remoting article that uses ServerSide ActionScript instead of a ColdFusion component.
function sayHello(){
return "Hello World";
}
open the example file in Flash MX and test your movie.
Of course, this is a really simple example. Play around with passing more complex data such as Arrays and RecordSets. Ill post more information later on how to make database calls, and load remote and local files into ServerSide ActionScript.
Neil Clark has created a Dreamweaver MX extension that utilized XML and Flash MX to add functionality to Dreamweaver MX.
It was designed from the outset to not only fit into the style of Dreamweaver MX, but to allow a once-only download of the Panel which could be extented by the end-user by creating a new dictionary definition of anything they choose in the Panel’s declared XML format, which in turn will show up automatically in the Panel.
Ton of content today. I have put together a quick example showing how to use Flash Remoting and ColdFusion MX to load data from a database into Flash MX.
You can view it here.
Btw, I will be posting a ServerSide ActionScript example sometime tomorrow.