Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Flash Remoting - Send Variables from CFMX

Posted on 2003-12-08
6
Medium Priority
?
205 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 1000 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
Independent Software Vendors: 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!

 
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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 …
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…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

618 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