# Dynamically add Video object on stage

**URL:** <https://forum.kirupa.com/t/dynamically-add-video-object-on-stage/227386>\
**Category:** flash\
**Created:** [May 29, 2007, 8:17pm UTC](https://forum.kirupa.com/t/dynamically-add-video-object-on-stage/227386 "2007-05-29T20:17:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanLiu](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ianliu/32/3068_2.png) [@IanLiu](https://forum.kirupa.com/u/IanLiu)\
**Post date:** [May 29, 2007, 8:17pm UTC](https://forum.kirupa.com/t/dynamically-add-video-object-on-stage/227386/1 "2007-05-29T20:17:34Z")

</div>

Hello there.

I’ve got into a problem when working with the Video object in Flash 7.  
I created a MovieClip with a video instance inside, named “video”.  
This MovieClip is associated with an action script class called “FlashVideo”,  
witch creates a NetConnection and a NetStream object to play a FLV video.

This is the class (quite simple):

```auto
class FlashVideo {
     public var video:Video; // Refer to the video instance inside the MovieClip
     public function FlashVideo() {
         var nc = new NetConnection();
         nc.connect( null );
         var ns = new NetStream( nc );
         this.video.attachVideo( ns );
         ns.play("http://www.helpexamples.com/flash/video/water.flv");
    }
}

```

Now I add an instance of the MovieClip on my stage, but the video doesn’t play…  
Any hints about this?

Thanks,  
Ian L.
