I am trying to do the same thing but am not sure where the problem is:
macromedia documentation is really lame.
so far I have this:
specifically, I am trying to get a cfc return an array into a flash movie.
I am trying to replace
pic_arr = ['1','2','3','4']
with
pic_arr = [array result from CFC]
8*******************************************
slides.cfc looks like: (is this correct?)
<cfcomponent displayName="grabSlides">
<cffunction name="grabSlides" access="remote" returnType="array">
<cfquery name="rsGrabSlides" datasource="fresh" >
SELECT Picture
FROM PICS
</cfquery>
<cfset returnArray = ArrayNew()>
<cfset returnArray = grabSlides>
<cfreturn returnArray>
</cffunction>
</cfcomponent>
- <cfcomponent displayName="grabSlides">
- <cffunction name="grabSlides" access="remote" returnType="array">
- <cfquery name="rsGrabSlides" datasource="fresh" >
- SELECT Picture
- FROM PICS
- </cfquery>
- <cfset returnArray = ArrayNew()>
- <cfset returnArray = grabSlides>
- <cfreturn returnArray>
- </cffunction>
- </cfcomponent>
*****************************************'
AS in .fla file looks like this: I am so far just testing to see if flash will read the array from CFC.
if (connected == null) {
connected = true;
NetServices.setDefaultGatewayUrl("http://flashfusion.net/flashservices/gateway");
var my_conn = NetServices.createGatewayConnection();
var myService = my_conn.getService("slides",this);
}
myService.grabSlides();
function grabSlides_Result(result) {
trace(arrayResult.length);
trace(arrayResult); // outputs: a,b,undefined,undefined,undefined
}
- if (connected == null) {
- connected = true;
- NetServices.setDefaultGatewayUrl("http://flashfusion.net/flashservices/gateway");
- var my_conn = NetServices.createGatewayConnection();
- var myService = my_conn.getService("slides",this);
- }
- myService.grabSlides();
- function grabSlides_Result(result) {
- trace(arrayResult.length);
- trace(arrayResult); // outputs: a,b,undefined,undefined,undefined
- }
macromedia support docs are totally weak and devoid of examples.
looking through various forums, this is one of THE MOST ASKED QUESTIONS.
get a clue MACROMEDIA .. support docs SUCK!