0

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!

Davy Says
  • 85
  • 1
  • 8
  • Please post the portion of your code that is failing. – Marcela Dec 11 '13 at 20:56
  • Hi Marcela, i updated it with a bit of explaining.. I cant show for now, because i don't know yet whats the best way to update a array if a user join new channel and store it to SharedObject. – Davy Says Dec 11 '13 at 21:05
  • why do you need to store it in a `SharedObject`? If the channels are only specific to a current session, just use a normal array – divillysausages Dec 12 '13 at 00:15
  • @divillysausages Because i need to get that info in which channels a user are to add buttons to switch between channels (to update nicklist and Textarea based on channelname) – Davy Says Dec 12 '13 at 10:34
  • I'm sorry, but from reading your question/code, I still can't get a good feel for what you're trying to accomplish. Hopefully someone else on here will be able to help you out. – Marcela Dec 12 '13 at 14:40

0 Answers0