all groups > macromedia flash flash remoting > october 2004 >
You're in the

macromedia flash flash remoting

group:

CFC Trouble



Re: CFC Trouble Pete
10/5/2004 12:16:55 AM
macromedia flash flash remoting: Did you set access="remote" on the CFC function?


[quoted text, click to view]

CFC Trouble Course Vector
10/5/2004 4:05:12 AM
I created a CFC that lists directories and jpgs. I can target it using a
normal coldfusion file and it works fine. The CFC is located at the root in a
folder named "remoting"

.cfm code:
<cfoutput>
<cfinvoke component="remoting.getDir" method="getList" directory=""
returnVariable="message" />
<cfdump var=#message#>
</cfoutput>

This works fine, and can be viewed here:
http://www.coursevector.com/remoting/test.swf

any help would be greatly appreciated.

-Gabriel
Re: CFC Trouble Course Vector
10/5/2004 5:02:50 AM
yes i did

<cffunction name="getList" access="remote" returnType="query">
which calls two other functions within itself:
<cffunction name="getImageList" access="remote" returnType="query">
and
<cffunction name="getDirList" access="remote" returnType="query">
Re: CFC Trouble Pete
10/5/2004 4:54:20 PM
Can you should be the client ActionScript code you're using to try and
contact the CFC via Flash Remoting?

Re: CFC Trouble Course Vector
10/6/2004 12:46:06 AM
i don't really understand what you wrote, but i tried the code locally and it works when i target the cfc locally. but as soon as i try to target it on the remote server it stops.

Re: CFC Trouble Pete
10/8/2004 1:50:21 PM
Sorry, I merged two sentences poorly...

Can you show me the client ActionScript that you're using to try and contact
the CFC via Flash Remoting?

Perhaps you've hardcoded localhost into the URL?

Re: CFC Trouble Pete
10/8/2004 2:35:53 PM
I only see a snippet from your CFC...


[quoted text, click to view]

Re: CFC Trouble Pete
10/8/2004 2:52:33 PM
Can you use the NetConnection Debugger to check whether anything is going
over the wire? Can you write out a text file in your CFC to prove it was
called? I'm not familiar with the remoting connector (I prefer to write the
script myself).



[quoted text, click to view]

Re: CFC Trouble Pete
10/8/2004 3:19:26 PM
Did you deploy the ColdFusion application to a custom web application
context (the default is the empty string "", but some people deploy things
to /cfmx etc)? If so, then that might have to go before the /flashservices
part of the gateway URL.

The URL is to a servlet, so in J2EE, this is configured in /WEB-INF/web.xml

There should be an entry in here for the FlashGateway in here... is it
something like the following:

<servlet-mapping id="macromedia_mapping_1">
<servlet-name>FlashGateway</servlet-name>
<url-pattern>/flashservices/gateway/*</url-pattern>
</servlet-mapping>

This determines which URL patterns are sent to the gateway for Flash
Remoting... what does your web.xml say here?

Re: CFC Trouble Course Vector
10/8/2004 6:14:25 PM
Re: CFC Trouble Course Vector
10/8/2004 6:45:35 PM
Originally posted by: Course Vector

AS Code:
myRemConn_rc.addEventListener("result", categoryResult);
myRemConn_rc.addEventListener("status", categoryStatus);
myRemConn_rc.gatewayUrl = "http://www.coursevector.com/flashservices/gateway/";
myRemConn_rc.methodName = "getList";
myRemConn_rc.serviceName = "remoting.getDir";
myRemConn_rc.suppressInvalidCalls = true;
myRemConn_rc.params = {directory:""};
_root.msg.text += "Triggering myRemConn Now...";
myRemConn_rc.trigger();
function categoryResult(ev:Object) {
_root.msg.text += "\nGot Categories - "+ev.target.results.length;
for( var i = 0; i< ev.target.results.length; i++) {
_root.msg.text += "\n " + ev.target.results._items[ i ].full;
}
}
function categoryStatus(stat:Object) {
_root.msg.text += "\nCategories Error - "+stat.code+" -
"+stat.data.faultstring;
}

it get's up to telling me it's triggering, but neither the fail or the result
function ever get called. This can be viewed here:
http://www.coursevector.com/remoting/test.swf

any help would be greatly appreciated.

-Gabriel


Re: CFC Trouble Course Vector
10/8/2004 7:13:39 PM
i tested it in flash with netconnection debugger and it spat this out:

"Error opening URL 'http://www.coursevector.com/flashservices/gateway/' "

well i guess this solves why nothing is getting called, but what gateway url
do i put in if this doesn't work?
any ideas?

-gabe
AddThis Social Bookmark Button