Skip to main content
Known Participant
February 26, 2007
Question

Cant get gc() to run

  • February 26, 2007
  • 19 replies
  • 1671 views
Hi guys i am trying to run application.gc on disconnect of all users.

quote:


application.onDisconnect = function(client){
trace("disconnect: " + client.name);
application.users_so.setProperty(client.name, null);
if (application.clients.length < 1){
application.gc();
applications.shutdown()
}
}



gc never seems to trigger and if i run a trace it returns false.

Anyone
    This topic is closed to new replies. Start a new post to keep the conversation going.

    19 replies

    Inspiring
    February 27, 2007
    keep tring maybe do something else untill you become a master with server side scripting .....you know do simple stuff and work your way up sounds like what you want to do is pretty complex so simplify your sever side scripting projects for a few days.
    Known Participant
    February 27, 2007
    quote:

    Originally posted by: calmchess333
    keep tring maybe do something else untill you become a master with server side scripting .....you know do simple stuff and work your way up sounds like what you want to do is pretty complex so simplify your sever side scripting projects for a few days.

    Ha ha great minds think alike :)
    Just spent the day building theCMS for the chatroom today.
    Known Participant
    February 27, 2007
    neither has worked. :(
    i tried to do a trace but nothing is returned
    quote:


    application.onDisconnect = function(client){
    trace("disconnect: " + client.name);
    application.users_so.setProperty(client.name, null);
    if (application.clients.length < 1){
    var names = application.users_so.getPropertyNames();
    for (k in names){
    var propVal = application.users_so.getProperty(names);
    trace("Value of property " + names + " = " + propVal);
    }
    save_history();
    }
    }

    Inspiring
    February 26, 2007
    save_history.prototype.isHistory_Result = function(result){
    application.users_so.clear();
    application.shutdown();
    }

    This will clear the shared object.

    -EDIT-

    Errr, I just did a bit more reading, so that might not work but if so, try this:

    save_history.prototype.isHistory_Result = function(result){
    var names = application.users_so.getPropertyNames();
    for (x in names){
    application.users_so.setProperty(names,null);
    }
    application.shutdown();
    }
    Known Participant
    February 26, 2007
    All i want to do is when the last user has left the room trigger a function of some sort to clear the SSO so that in the off chance that the user decides to go back into the room a minute later the previuos conversation is gone.
    So i need to clear the SSO but i dont know how to do that.
    Inspiring
    February 26, 2007
    I guess I don't understand how you are writing to the database sorry I was just putting in my two cents.........I write to my database using php so maybe what I said above isn't relevent to your situation and you should repost this question....or give your code a try untill you succeed.
    Known Participant
    February 26, 2007
    those 2 links you posted in a previous post and dont help my situation and have nothing to do with SSO

    What gives??
    Inspiring
    February 26, 2007
    here are two links the first one shows all of the server side actionscript that you can use the second one is the serverside shared object methods and such.

    http://livedocs.adobe.com/fms/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000649.html


    http://livedocs.adobe.com/fms/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000649.html
    Known Participant
    February 26, 2007
    Would this be the correct code to clear the SSO?
    quote:


    save_history.prototype.isHistory_Result = function(result){
    application.users_so.setProperty(null, null);
    application.shutdown();
    }


    ?

    thanks
    Known Participant
    February 26, 2007
    Do u mind explaining a bit more. The docs are not worth a f*ck
    Inspiring
    February 26, 2007
    sure I can explain more a remote shared object does nothing more than hold data so when you are done using the data then clear the remote shared object the easiest way to clear it is to pass null to the remote shared object which tells it data doesn't exsist in the remote shared object or you can pass double quotes SO.data.slot1 = " "; to it also which is the same as passing null.If you want to pass the contents of a dynamic text field into two objects you would just write.... SO.data.slot1=mytext.text; SO.data.slot2 = mytext.text;
    Inspiring
    February 26, 2007