A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Deleting Objects

  1. #1
    I am deleting items from the sample guestbook with this code:

    function itemClicked(pictureID){
    _root.entries_so.data[pictureID] = null;
    _root.doRefresh();
    }


    Strange things happen such as deleting more than 1 object. Also once I delete an object this way, I can no longer add objects to the server. I have to clean out the server side data and reload the application and start fresh.

    Since this doesn't work, how would I use the stream.clear() to delete and object?

    I know you would put the something like the following code into main.asc

    application.onConnect = function(client, id){
    s = Stream.get("foo");
    if (s){
    s.onStatus = function(info){
    if(info.code == "NetStream.Clear.Success"){
    trace(info.description);
    }
    if(info.code == "NetStream.Clear.Failure"){
    trace(info.description);
    }
    };
    s.clear();
    }
    }


    I have no clue if this is how I would setup up this function on the server side and I am not sure how to call it saying that I want pictureID deleted.

    Any help would be greatly appreciated.

    Chris

  2. #2
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Hey - If you want to delete an entire so on the server-side, you can use:

    sharedObject.clear();

    You don't need to use any the stream stuff. Check in the docs under SharedObject for the server side.

    You may be able to just do something like:

    delete my_so.data[pictureID];

    but I haven't tried it!

    Psx

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