Best Way to update Array with SharedObject As3

109 views Asked by At

I just made a irc client with as3, but the problem is that i don't have too much experience with SharedObject. I need a best way to update an array when a user join other channels.

For example, if i have this array:

var channels:Array = [];

I also have a function where i can get vars if a user join other channels and when the use do that, array must be updated, without removing vars thats already exist in array, but i fails everytime in this. What's the best way to update array for one item such like for "Channels", it must be looks: "'#channel1', '#channel2', '#channel3'". Sorry for my bad english, i am from the netherlands.

To make a bit more clear:, this is one of in switch() for user commands:

case "JOIN":
    if(sCmd.split(" ")[1] == "")
    {
        sendNoticeToServerAndChatroom("Geef een kanaal op.");
    } else {
        var getJoinChannel = sCmd.split(" ")[1];
        sendCommand("JOIN", [getJoinChannel]);
                     // Here must be a code that sends every channels to a array <- (channels:array = [];)
        goToRoom();
    }
break;

Thanks!

0

There are 0 answers