jrmcintosh
05-25-2005, 02:13 PM
I'm having a lot of problems getting flash remoting to work. I have installed the AS 1.0 remoting components and am using Ben Forta's first simple example in the book CFMX App. Const. Kit. I'm using a hosting place that
says it supports Flash Remoting. The only thing I'm unsure of is where to point to get the NetServices.as. I have asked the hosting company but they have not gotten back to me yet. I'm using an html page to deliver this.
I'm pretty certain I have everything right since I copied it directly from the book. I have created a datasource called owsdb and have created a CF datasource pointing to that database, it points to this datasource in the Application.cfc. I can not get the Simple Search function to work. I don't get any errors I just get nothing.
Here's my Actionscript, CF code, and URL.
Actionscript:
#include "NetServices.as"
// --------------------------------------------------
// Application initialization
// --------------------------------------------------
if (inited == null)
{
// do this code only once
inited = true;
// set the default gateway URL (this is used only in authoring)
NetServices.setDefaultGatewayUrl("http://hosting2.hosting-coldfusion.com/flashservices/gateway")
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to a service
// In this case, the "service" is the /ows/26 directory in web server root
myService = gateway_conn.getService("ows.26", this);
}
CF code:
<!---
Filename: SimpleSearchProvider.cfm
Purpose: Provides a simple film search service for a Flash MX movie
--->
<!--- We are expecting a SearchString parameter from Flash --->
<cfparam name="FLASH.searchstring" type="string">
<!--- Query the database for any matching film records --->
<cfquery name="searchQuery" datasource="#APPLICATION.dataSource#" maxrows="1">
SELECT *
FROM Films
WHERE MovieTitle LIKE '%#FLASH.searchstring#%'
</cfquery>
<!--- Set the FLASH.Result variable to the summary of the returned film --->
<!--- This will be available as the “result” variable in the --->
<!--- SimpleSearchProvider_Result handler within the Flash movie --->
<cfset FLASH.result = searchQuery.summary>
URL:
http://hosting2.hosting-coldfusion.com/jrmcintosh501355/ows/26/simplesearchmovie.html
Any help would be greatly appreciated as I've been trying to figure this out for a week.
Thanks,
Jason
says it supports Flash Remoting. The only thing I'm unsure of is where to point to get the NetServices.as. I have asked the hosting company but they have not gotten back to me yet. I'm using an html page to deliver this.
I'm pretty certain I have everything right since I copied it directly from the book. I have created a datasource called owsdb and have created a CF datasource pointing to that database, it points to this datasource in the Application.cfc. I can not get the Simple Search function to work. I don't get any errors I just get nothing.
Here's my Actionscript, CF code, and URL.
Actionscript:
#include "NetServices.as"
// --------------------------------------------------
// Application initialization
// --------------------------------------------------
if (inited == null)
{
// do this code only once
inited = true;
// set the default gateway URL (this is used only in authoring)
NetServices.setDefaultGatewayUrl("http://hosting2.hosting-coldfusion.com/flashservices/gateway")
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to a service
// In this case, the "service" is the /ows/26 directory in web server root
myService = gateway_conn.getService("ows.26", this);
}
CF code:
<!---
Filename: SimpleSearchProvider.cfm
Purpose: Provides a simple film search service for a Flash MX movie
--->
<!--- We are expecting a SearchString parameter from Flash --->
<cfparam name="FLASH.searchstring" type="string">
<!--- Query the database for any matching film records --->
<cfquery name="searchQuery" datasource="#APPLICATION.dataSource#" maxrows="1">
SELECT *
FROM Films
WHERE MovieTitle LIKE '%#FLASH.searchstring#%'
</cfquery>
<!--- Set the FLASH.Result variable to the summary of the returned film --->
<!--- This will be available as the “result” variable in the --->
<!--- SimpleSearchProvider_Result handler within the Flash movie --->
<cfset FLASH.result = searchQuery.summary>
URL:
http://hosting2.hosting-coldfusion.com/jrmcintosh501355/ows/26/simplesearchmovie.html
Any help would be greatly appreciated as I've been trying to figure this out for a week.
Thanks,
Jason