Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-16-2004, 04:36 PM   #1
brandonk
Registered User
 
Join Date: Jul 2004
Posts: 1
Default Can Only Components Connect Through SimpleConnect?

I have some whiteboard shared objects I've created, but do not want to create a new NetConnection(); since I already have SimpleConnect component running. This is to avoid 2 NetConnections for each user who is logged in.

How can I connect my newly created shared objects to the existing SimpleConnect Connection?

example:

pen_so = SharedObject.getRemote("pen", "simpleconnect uri", false);
pen_so.connect("simpleconnect netconnection");
pen_nc.connect("simpleconnect application directory");

Does this make sense? Is it possible?

**********************************

Or, do I connect my whiteboard remote shared objects to a "new instance" of the application directory?

newConnect = new NetConnection();
pen_so = SharedObject.getRemote("pen", newConnect.uri, false);
pen_so.connect(newConnect);
newConnect.connect("rtmp://ip_address/application/newinstance");

Thanks,
Brandon
brandonk is offline   Reply With Quote
Old 08-03-2004, 01:51 AM   #2
compwiz1999
Registered User
 
Join Date: Aug 2004
Posts: 5
Default Connecting sharedobject to simpleconnect component.

Hello Brandonk,

Assuming your simpleconnect is called "simple_mc", This is what I would do...

After the simpleconnect component has successfully connected to your app, do this:

//Declare a variable to hold a reference to the simpleconnect connection
var main_nc;

//Assign the simpleconnect component's connection to your variable
main_nc = simple_mc.main_nc;

//Then you can connect your sharedobjects using your new reference
//Sample sharedobject
function penSharedObject() {
pen_so = SharedObject.getRemote("pen", main_nc.uri, false);
pen_so.onSync = function(list) {

trace("Yeah, I'm connected!");

}
pen_so.connect(main_nc);
}


Hope that helps!

Jorge Hernandez














Quote:
Originally Posted by brandonk
I have some whiteboard shared objects I've created, but do not want to create a new NetConnection(); since I already have SimpleConnect component running. This is to avoid 2 NetConnections for each user who is logged in.

How can I connect my newly created shared objects to the existing SimpleConnect Connection?

example:

pen_so = SharedObject.getRemote("pen", "simpleconnect uri", false);
pen_so.connect("simpleconnect netconnection");
pen_nc.connect("simpleconnect application directory");

Does this make sense? Is it possible?

**********************************

Or, do I connect my whiteboard remote shared objects to a "new instance" of the application directory?

newConnect = new NetConnection();
pen_so = SharedObject.getRemote("pen", newConnect.uri, false);
pen_so.connect(newConnect);
newConnect.connect("rtmp://ip_address/application/newinstance");

Thanks,
Brandon
compwiz1999 is offline   Reply With Quote
Old 03-29-2007, 11:31 AM   #3
jo-flash-adventures
jo-flash-adventures (new)
 
Join Date: Mar 2007
Location: Philippines
Posts: 1
Send a message via ICQ to jo-flash-adventures
Default

what do you mean of this?
Quote:
After the simpleconnect component has successfully connected to your app, do this:
I tried your solution, I mean I copy pasted your solution to the 1st and only frame of my application, all the other components are working and I see their SharedObjects in the FMS2 console, except the sharedobj created by your solution, I can't even see the trace, in the livelog of the FMS2 console. Please help, is there any other way of reusing the existing connection created by the simpleconnect component? reusing it for another sharedobject to broadcast a client's click event on a button to all connected clients including the clicker.
jo-flash-adventures is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:31 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.