# FLV in For Loop

**URL:** <https://forum.kirupa.com/t/flv-in-for-loop/86866>\
**Category:** flash\
**Created:** [April 16, 2005, 7:19am UTC](https://forum.kirupa.com/t/flv-in-for-loop/86866 "2005-04-16T07:19:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedhu0920](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jedhu0920/32/905_2.png) [@jedhu0920](https://forum.kirupa.com/u/jedhu0920)\
**Post date:** [April 16, 2005, 7:19am UTC](https://forum.kirupa.com/t/flv-in-for-loop/86866/1 "2005-04-16T07:19:51Z")

</div>

OK, i have ten FLVs named video0.flv through video10.flv. I want to attach them to the stage using a for loop.

I have managed to make one work using some code I got from bit-101 blog… [http://www.bit-101.com/blog/archives/000074.html](http://www.bit-101.com/blog/archives/000074.html)

```auto

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
//attaches flv to video player on stage named "vid"
vid.attachVideo(ns);
ns.play("video0.flv");

```

the code is just on the first frame of the timeline. I made a new video instance and put it on the stage and named it vid.

It seems to me that I would need to make unique NetConnection and Netstream variables to assign them to the 10 different embedded videos instances that I will be creating…but I don’t know how to do that…

How would I plug this code into a for loop and also duplicate the embedded video instance on stage to put all ten flv on stage?
