A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Dynamic SharedObjects

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    9
    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]

  2. #2
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    You definitely can. I'm not sure where the error is in your code, but try something like so:
    Code:
    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

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    9
    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

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Posts
    9
    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

  5. #5
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    i would like to contribute for that Private Chat. if you are interested drop a mail to me. me_at_arckid_dot_com
    Ashvin Savani (Arckid)

    CEO & Founder, Avinashi Systems Pvt. Ltd.
    Team Macromedian
    Avinashi Videomail - My latest work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center