Groups | Blog | Home
all groups > coldfusion flash integration > may 2007 >

coldfusion flash integration : CF pass variables to Flash


lvbao
5/1/2007 1:54:26 PM
Hello:

Basically I want Coldfusion to pass the server date to Flash. But I get
'#theDt#' instead of the value of 'theDt' please see the code below:

Thank you in advance.

************************************************
theDate.cfm

<cfsetting enableCFoutputOnly="Yes">
<cfset theDt = dateFormat(now(), 'mm-dd-yyyy')>
<cfoutput>
&serverDate=#theDt#
</cfoutput>
*****************************************************************

var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if(success) {
theDate.text = my_lv.serverDate;
//theDate.text = this['serverDate'];
//theDate.text = this.serverDate;
} else {
var localDate:Date = new Date();
theDate.text =
(localDate.getMonth()+1)+"/"+localDate.getDate()+"/"+localDate.getFullYear();
}
}
my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.cfm");
***************************************************************
BKBK
5/3/2007 5:12:17 AM
I think it doesn't work because the flash variable [i]serverDate[/i] is not known to Coldfusion and the Coldfusion variable serverDate is not known to Flash.

Sojovi
5/3/2007 2:15:38 PM
my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.cfm");

You are not "executing" a CF page, just reading the content.

The route should be something like (if you are testing in your machine) :
my_lv.load("http://127.0.0.1//OC//theDate.cfm"); or the URL corresponding (and
the webserver must be configured to execute CF pages)

Regards
BKBK
5/5/2007 12:00:00 AM
lvbao
5/8/2007 10:26:48 PM
AddThis Social Bookmark Button