all groups > macromedia flash flashcom > august 2007 >
You're in the

macromedia flash flashcom

group:

shared object problem


shared object problem asmaa13
8/20/2007 12:00:00 AM
macromedia flash flashcom: 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

Re: shared object problem JayCharles
8/20/2007 12:00:00 AM
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.
Re: shared object problem asmaa13
8/23/2007 12:00:00 AM
Thank you
can you clear your answer , please
because i still confuse
Re: shared object problem JayCharles
8/23/2007 12:00:00 AM
AddThis Social Bookmark Button