Solved

Flash Remoting - Send Variables from CFMX

Posted on 2003-12-08
6
180 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now