Groups | Blog | Home
all groups > macromedia flash flash remoting > june 2004 >

macromedia flash flash remoting : Remoting problem loading multiple swfs



Dechirico0
6/5/2004 11:01:59 PM
I have created 3 flash files: main.swf, one.swf, and two.swf. Both one and two
connect to different cfc's using flash remoting. When accessing the swf's
directly they both work fine. Main.swf is the container and I load one.swf and
two.swf as separate pages into main.swf using the loader component. This is
where the problem arises. The child swf's load fine, but only the first swf
accessed connects with flash remoting, the other (accessed 2nd) does not. I am
using Flash MX 2004 Professional. Both child swf's have the following code:

#include "NetDebug.as"
#include "NetServices.as"
#include "DataGlue.as"
// Connect to the gateway and create a service object
if (connected == null) {
connected = true;
NetServices.setDefaultGatewayUrl("http://127.0.0.1flashservices/gateway");
var my_conn = NetServices.createGatewayConnection();
my_conn.onStatus = errorHandler;
var myService = my_conn.getService("cfcName");
myService.cfcFunction();
}

Do I need to move this code to the parent? Not sure what's causing only one
Remoting connection to work.

Any help would be greatly appreciated.

Thx.

Dechirico0
Paul Whitham TMM
6/10/2004 3:04:29 PM
I suspect the problem is that the first flash is creating the connection so
all of the code block that creates the connection in the second one is being
ommitted. In order to prove this I would comment out the lines

if (connected == null) {
connected = true;

and the closing } from your second flash file and see if it works

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

[quoted text, click to view]

AddThis Social Bookmark Button