• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Flash Remoting - Send Variables from CFMX

OK, I established in a previous question that I am going to use Flash remoting and CFMX as the interaction engine.  Here's what I need to do but I am not getting much help from the books and online info that I am reading:

Objective: Call all the JPG files in a certain directory and create a automated slide show.

I am having problems at steps 2, & 5

1. SWF file is embedded in HTML homepage
2. SWF file calls CFC
3. CFC runs cfdirectory to see what's in specified directory
4. All files in the directory are returned and assigned to an array
5. Array and other variables (recordcount, etc.) is returned to SWF file
6. SWF file generates load images, and slider/delay controls for the images

Anyone want to walk me though this?
0
skibama1
Asked:
skibama1
  • 3
  • 3
1 Solution
 
negatyveCommented:
#include "NetServices.as"

// create connections
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
remote_conn = NetServices.createGatewayConnection();

getJPGservice = remote_conn.getService("path.component_cfc_name");

// create a custom listener
my_listener = {path:this};
// create the onResult function
my_listener.onResult = function(result)
{
      // trace the array results of items returned by the server
      for(var i = 0; i < result.getLength(); i++){
            trace(result.getItemAt(i));            
      }
};
// call the remote method on the server
// change CFC_METHOD_NAME with the correct name
getJPGservice.CFC_METHOD_NAME(my_listener);

// if there are any parameters, call the function
// this way:

//getJPGservice.CFC_METHOD_NAME(my_listener, parameters);
0
 
skibama1Author Commented:
re:

NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");

Should "localhost" be changed to a directory on the webserver?
0
 
negatyveCommented:
>Should "localhost" be changed to a directory on the webserver?

yes, to the domain name of the server where the flashservices (Flash Remoting server) is installed
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
skibama1Author Commented:
Holy cow, this is harder than I thought.  Let me work on this a few days.  More than likely I will end up posting my code.  I am understanding the concept it's just getting it into coded form that is stumping me.  Once I get it though I'm sure it will cross over to other projects.

Stay Tuned....
0
 
negatyveCommented:
That's ok, take your time (but before deploying your application to a public webserver, test it on your local one)... :)
0
 
skibama1Author Commented:
OK. I got it to dump an array with all the file names of the jpg's that I want to load.

Here's what I want to do now:

I want to create a new movie clip for each item in the array, insert the jpg, attach & display (is that the same thing?) the movie to the timeline, pause for a certain amount of time (say 5 seconds), unload that clip then load the next one..and so on.

Here's some code that i have been playing with but I get nothing out of it.  I traced it to make sure that the function was being called and it was.

for (i=1; i<result.length; i++) {
      _root.createEmptyMovieClip("jpg[1]");
                 trace("being accessed");
      _root.attachMovie(jpg[i]);
      loadMovie(result[i]);
}
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now