# New Connection threaded Array

**URL:** <https://forum.kirupa.com/t/new-connection-threaded-array/225824>\
**Category:** flash\
**Created:** [May 16, 2007, 2:32am UTC](https://forum.kirupa.com/t/new-connection-threaded-array/225824 "2007-05-16T02:32:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [May 16, 2007, 2:32am UTC](https://forum.kirupa.com/t/new-connection-threaded-array/225824/1 "2007-05-16T02:32:11Z")

</div>

I’m trying to build a program that can connect to all chat rooms that are create

```auto

_global.chat = new Array(new NetConnection());
_global.roomsOn = new Array(1,2,3,4,5);

for (p=0; p<=_global.roomsOn.length; p++)
{
    _global.chat[p].connect("rtmp://www.myroom.com/rooms/" + _global.roomsOn[p], "Server");
    users_so[p] = new Array(SharedObject.getRemote("users_so", _global.chat[p].uri, false));
    users_so[p].connect(_global.chat[p]);
}

```

The problem is, it will only connect to the first room in the roomsOn array, and neglect to connect to the rest… Any ideas on how I can fix it. 🙂
