Click to See Complete Forum and Search --> : Dynamic SharedObjects
Vinod Sharma
09-03-2002, 07:25 AM
Hi, I would like to know whether we can declare a sharedObject dynamically. I mean something like the following:
var history = eval("_root." + userName).data.history;
if (history == undefined || history == null) {
newSharedObj = eval("_root." + newUserName);
newSharedObj = SharedObject.getRemote(shObjName,false);
newSharedObj.connect(_root.client_nc);
}
The basic idea is to create a sharedObject on the fly and connect it.
Hope somebody out there can help me.
Thanks in advance.
Vinod Sharma
vinod@vsplash.com
[Edited by Vinod Sharma on 09-03-2002 at 09:27 AM]
psychlonex
09-04-2002, 04:41 PM
You definitely can. I'm not sure where the error is in your code, but try something like so:
main_nc = new netConnection();
main_nc.connect("rtmp://myserver.com/my_app");
my_so = SharedObject.getRemote(varname, main_nc.uri, false);
my_so.connect(main_nc);
Psx
Vinod Sharma
09-18-2002, 04:06 AM
Hi Psx,
Sorry for being late on the acknowledgement...thanks all the same for the help.
I am working on a private chat app and am presently stuck with the following issue.
How to save and retrieve the private chat history of, lets say, userA, with userB, userA with userC, etc...
What I want is that, suppose I connect as userA and then chose userB or userC (who are already connected), for private chat, then, my chat history with that particular user should come up, if present.
I am dynamically creating and connecting sharedObjects whenever I chose a user for private chat, (thanks to Psx), but I am unable to connect to them on the server-side (main.asc)?
Am I on the right track? Nothing seems to be working...
Hope you and/or others out there can help me soon.
Thanks in advance.
Vinod
Vinod Sharma
10-04-2002, 01:56 AM
Hi..I have been able to workaround that issue by using local shared objects. There could possibly be a better solution than mine..buts its working all the same.
Thanks
aashu.com
11-02-2002, 12:23 AM
i would like to contribute for that Private Chat. if you are interested drop a mail to me. me_at_arckid_dot_com
flashkit.com
Copyright Internet.com Inc., All Rights Reserved.