Solved

Flash Remoting - Send Variables from CFMX

Posted on 2003-12-08
6
193 Views
Last Modified: 2010-04-03
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
Comment
Question by:skibama1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 250 total points
ID: 9902280
#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
 
LVL 1

Author Comment

by:skibama1
ID: 9908435
re:

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

Should "localhost" be changed to a directory on the webserver?
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9908478
>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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Author Comment

by:skibama1
ID: 9910683
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
 
LVL 27

Expert Comment

by:negatyve
ID: 9910739
That's ok, take your time (but before deploying your application to a public webserver, test it on your local one)... :)
0
 
LVL 1

Author Comment

by:skibama1
ID: 9946511
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question