You're declaring it as a public variable, so if your other class has a
relationship with your main instance you should have direct access:
yourMainInstance._sharedBoardObject;

I suspect what you're missing is a relationship with the instance of
Main.

Barry



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of ktt
Sent: Thursday, 15 October 2009 9:33 a.m.
To: [email protected]
Subject: [Flashcoders] Access shared object from other class


Hello,

How to acces remote shared object from other class?

I have

package {
       import flash.net.*;
       import flash.display.*;

       public class Main extends Sprite {

               public var _sharedBoardObject:SharedObject;
               public var ncBoard:NetConnection;
               public var rtmpAddress:String;

               public function Main():void {

                       ncBoard = new NetConnection();
                       rtmpAddress = "rtmp://192.168.0.1/myApp";
                       ncBoard.connect(rtmpAddress);
                       _sharedBoardObject =
SharedObject.getRemote("sharedBoard02",
ncBoard.uri, false);
                       _sharedBoardObject.connect(ncBoard);

               }
       }
}

I would like to add some data or modify shared object.
How can I acces _sharedBoardObject from another class?
Or maybe I need to connect to "sharedBoard02" directly?

Regards,
Ktt


      
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to