Skip to main content
Participant
August 20, 2007
Question

shared object problem

  • August 20, 2007
  • 3 replies
  • 277 views
hi
i make this flash server

import mx.data.components.WebServiceConnector;

client_nc = new NetConnection();
client_nc.connect("rtmp:/prodd");
time= SharedObject.getRemote("sharedtime", client_nc.uri, false);
time.connect(client_nc);
var res1:Function = function (evt1:Object) {
my_array1.removeAll();
n = evt1.target.results.length;
for (var i = 0; i<n; i++) {
my_array1.push(evt1.target.results);
}
time.data.arraycase30 = my_array1;
};
var wsConn1:WebServiceConnector = new WebServiceConnector();
wsConn1.addEventListener("result", res1);
wsConn1.WSDLURL = " http://127.0.0.1/web2flash/service.asmx?WSDL";
wsConn1.operation = "getCase30Companies";
wsConn1.params = ["mhefny", "mhk"];
wsConn1.suppressInvalidCalls = true;
wsConn1.trigger();
setInterval(Recase30, 2000);
function Recase30():Void {
wsConn1.trigger();
}


and i uplaod this flash server into the server it's ip is 81.12.127.100 and placed the flash server in C:\Program Files\Macromedia\Flash Media Server 2\applications\prodd

and i make flash client to read the shared object from flash server

import mx.data.components.WebServiceConnector;
client_nc = new NetConnection();
client_nc.connect("rtmp://81.12.127.100/prodd");
time= SharedObject.getRemote("sharedtime", client_nc.uri, false);
time.connect(client_nc);

time.onSync = function(list) {

// display code

};

the problem is the client doesn't work

can anyone help me
    This topic has been closed for replies.

    3 replies

    August 23, 2007
    I'm not sure if I can make it any clearer. Have you read the FMS server side actionscript documentation?
    asmaa13Author
    Participant
    August 23, 2007
    Thank you
    can you clear your answer , please
    because i still confuse
    thank you again
    August 20, 2007
    Your server side code is the main problem. Keep in mind that FMS does not support AS3 (it just javascript really), and the syntax for the sharedobject constructor is different. On the server side, it looks like this:

    application.someSharedObject = SharedObject.get("foo");

    Unless you're connecting to another application instance to get the sharedObject (it doesn't seem that your are), then as far as the server is concerened, the SO is local, so you don't need a netconnection.

    Also, on the client side, it's best to define your onSync handler before you connect to the SO.