Solved

Flash Remoting - Send Variables from CFMX

Posted on 2003-12-08
6
196 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

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!

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

726 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