# Dynamic netStreams and naming them

**URL:** <https://forum.kirupa.com/t/dynamic-netstreams-and-naming-them/230414>\
**Category:** flash\
**Created:** [June 26, 2007, 3:58am UTC](https://forum.kirupa.com/t/dynamic-netstreams-and-naming-them/230414 "2007-06-26T03:58:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)\
**Post date:** [June 26, 2007, 3:58am UTC](https://forum.kirupa.com/t/dynamic-netstreams-and-naming-them/230414/1 "2007-06-26T03:58:08Z")

</div>

Hi,

I have a video app that uses many cameras. I create netStream objects with a for loop and I put them all into an array - aNS[].

```auto

for(var i:int=0; i<4; i++){
    aNS* = new NetStream(aNC*);
    aNS*.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
}

```

Then I have the netStreamHandler function which is called when the NetStatusEvent.NET\_STATUS is envoked - great all of this works perfectly.

```auto

function netStreamHandler(event:NetStatusEvent):void {
     trace(event.target.name)
}

```

except for the trace - How can I add a name to the netStream so when the netStreamHandler is called the trace kicks back the name of the netStream.

I do this all the time with other objects like buttons, videos, comboBoxes etc … but when I try to do the same to the netStream I always get errors.

How is this done?

waffe
