Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
RuneV #1
Problem using form variable i actionscript
Hi,
I have been trying for a couple of days to figure out how to reference form
data in an actionscript I'm using to invoke a CFC.
I'm trying to pass on a value from a cfselect to a CFC through actionscript. I
don't know if it's the right to accomplish what I'm trying to do. It feels like
the solution is so obvious but it's eluding me =(
When running the code it's telling me that the variable suppose to be passed
to the CFC doesn't reach it.
Any help would be greatly appreciated.
The CFC
<cfcomponent output="false">
<cffunction name="getReports" access="remote" returntype="query"
output="false">
<cfset var p_PortalReport_Get_RS1 = ''>
<!--- SP fetching data --->
<cfstoredproc datasource="#Application.DSN#" procedure="p_PortalReport_Get">
<cfprocparam type="in" cfsqltype="cf_sql_integer" value="1">
<cfprocresult name="p_PortalReport_Get_RS1">
</cfstoredproc>
<cfquery name="ReportNameQry" dbtype="query">
select reportid, report
from p_PortalReport_Get_RS1
</cfquery>
<!--- Retuning the data --->
<cfreturn ReportNameQry>
</cffunction>
<cffunction name="getDescription" access="remote" output="false">
<!--- Required arguments from caller --->
<cfargument name="reportid" required="yes" type="numeric">
<cfset var p_PortalReport_Get_RS1 = ''>
<!--- SP fetching data --->
<cfstoredproc datasource="#Application.DSN#" procedure="p_PortalReport_Get">
<cfprocparam type="in" cfsqltype="cf_sql_integer" value="1">
<cfprocresult name="p_PortalReport_Get_RS1">
</cfstoredproc>
<cfquery name="ReportDescription" dbtype="query">
select description
from p_PortalReport_Get_RS1
where reportid = #Arguments.reportid#
</cfquery>
<cfoutput>
<cfset descriptionString = "#ReportDescription.description#">
</cfoutput>
<!--- Retuning the data --->
<cfreturn descriptionString>
</cffunction>
</cfcomponent>
The cfm page
<cfform format="flash" skin="halosilver" height="480" width="300"
onload="getData()" >
<cfformitem type="script">
public function getData():Void{
<cfoutput>
//create connection
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("h ttp://#cgi.HTTP_HOST#/flashser
vices/gateway/");
//declare service
var myService:mx.remoting.NetServiceProxy;
</cfoutput>
//make an object that will handle the response
var responseHandler = {};
//put the controls in scope to avoid calling _root
var reportName = reportName;
//function that receives the response
responseHandler.onResult = function( results: Object ):Void {
//when results are back, we show the text received
reportName.labelField = "report";
reportName.dataProvider = results;
}
//function that receives any error that may have occurred during the
call
responseHandler.onStatus = function( stat: Object ):Void {
//if there is any error, show an alert
alert("Error while calling cfc:" + stat.description);
}
//get service. First parameter is path to component and
//the second it's the object that will handle the response
myService = connection.getService("reports.reportsComponent",
responseHandler );
//make call
myService.getReports();
}
public function getDescription():Void{
<cfoutput>
//create connection
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("h ttp://#cgi.HTTP_HOST#/flashser
vices/gateway/");
//declare service
var myService:mx.remoting.NetServiceProxy;
</cfoutput>
//make an object that will handle the response
var responseHandler = {};
//put the controls in scope to avoid calling _root
var Description = Description;
var reportName = reportName;
//function that receives the response
responseHandler.onResult = function( results: Object ):Void {
//when results are back, we show the text received
Description.text = results;
}
//function that receives any error that may have occurred during the
call
responseHandler.onStatus = function( stat: Object ):Void {
//if there is any error, show an alert
alert("Error while calling cfc:" + stat.description);
}
var input = reportName.selectedItem.data;
//get service. First parameter is path to component and
//the second it's the object that will handle the response
myService = connection.getService("reports.reportsComponent",
responseHandler );
//make call
myService.getDescription();
}
</cfformitem>
<cfformgroup type="page">
<cfselect name="reportName" id="reportName" label="Report"
onChange="getDescription()">
</cfselect>
<cfformitem type="spacer" height="15" />
<cftextarea name="Description" label="Description" /> <!---
{testSelect.selectedItem.data} --->
<cfformitem type="spacer" height="25" />
<cfinput type="submit" name="submit" value="Submit">
</cfformgroup>
</cfform>
RuneV Guest
-
Flash form actionscript
My first experience with actionscript is 3.0 because I recently got heavily into Flex 2 development. I am working on a new site that has a simple... -
How do I obtain a URL variable in actionscript?
Hi, I'd be very grateful if somebody could please help me with this issue. Here is the situation: Let's say I've got the following... -
Cannot pass form field variable from Flash form to CFC
hello, could someone please help me with an issue i'm having.... i'm trying to pass data from flash form fields into my coldfusion component... -
form Variable problem
I got 2 forms (Main & action page). Main has a list & submits a url value depending on item clicked. The url variable now forms part of the query... -
HELP! Variable variables in actionscript.
OK, the following is output from PHP to FLASH: xPosition=5&yPosition=10&dupNo=1&xPosition0=7&yPosition0=9 dupNo is the number of times I'm...



Reply With Quote

