# Need help on flv player

**URL:** https://forum.kirupa.com/t/need-help-on-flv-player/265875
**Category:** Uncategorized
**Created:** [July 14, 2008, 2:33am UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875 "2008-07-14T02:33:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)
#### Post date: [July 14, 2008, 2:33am UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875/1 "2008-07-14T02:33:41Z")

</div>

Hi…everyones…

here’s are the flv question again…just wanna asking u guys opinion why when i try to shift the timelien code to external class code it didnt play the video as suppose to…is soemethign wrong with the code…  
//heres the frame based code …which is working ok and great…

```auto

stop();

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoContainer.attachVideo(ns);
ns.play("water.flv");

```

then I try to convert to class file…and here;s the class

```auto

class FlvPlayer{
    private var __theVid:String;
    private var nc:NetConnection;
    private var ns:NetStream;
    private var __videoContainer:Video;
    //constructor
    function FlvPlayer(thevid:String,videoContainer:Video){
        this.__theVid = thevid;
        this.__videoContainer = videoContainer;
        trace(typeof this.__videoContainer);
        init();
    }
    
    private function init():Void{
        var nc:NetConnection = new NetConnection();
        nc.connect(null);
        
        var ns:NetStream = new NetStream(nc);
        playVideo();
    }
    
    private function playVideo():Void{
        this.__videoContainer.attachVideo(ns);
        ns.play(this.__theVid);
    }
}

```

and in my flas…i just instantiate the class…

```auto

stop();

var myVid:FlvPlayer = new FlvPlayer("water.flv",videoContainer);

```

the the result is empty…the code does not playing the video lol…so whats wrong with this code…just wanna get insight before I can further coding the rest…thnks in advanced everyones…🙂

---

<div class="post-metadata">

### Author: ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)
#### Post date: [July 14, 2008, 9:21am UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875/2 "2008-07-14T09:21:58Z")

</div>

I’d advise you to keep that code in the flash file

also is it my imagine-nation but classes load into 1 level only, you have to reference everything from one level… as you should

---

<div class="post-metadata">

### Author: ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)
#### Post date: [July 14, 2008, 8:07pm UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875/3 "2008-07-14T20:07:47Z")

</div>

hello [pixeldude](http://www.kirupa.com/forum/member.php?u=14318) your class seemed to have a small problem …

you first made the net connection and netstream as private variables… but ended up creating local copies of them again in the init function.

so there was a scope referencing problem here :  
ns.play(this.\_\_theVid);

My suggestion to you… move towards external file based scripting…from #include to pure object oriented classes… thats the future… the faster you adapt … the sooner you will get in contact with actionscript 3.0

---

<div class="post-metadata">

### Author: ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)
#### Post date: [July 15, 2008, 2:12am UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875/4 "2008-07-15T02:12:29Z")

</div>

\*\*randomagain:\*\*I wish i can do that heheh…anyway thanks for ur time mate!!!

\*\*sparkdemon:\*\*My bad lol…must be overlooking…no wonder i cant call the ns object since I make it as local variable…anyway thanks to u mate… ![](http://forum.kirupa.com/uploads/kirupa/6729/14417baaf4fee510.gif) it work now…also thanks for ur support since Im also learning AS3 by try and error…

---

<div class="post-metadata">

### Author: ![pqrs552](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pqrs552](https://forum.kirupa.com/u/pqrs552)
#### Post date: [July 15, 2008, 2:05pm UTC](https://forum.kirupa.com/t/need-help-on-flv-player/265875/5 "2008-07-15T14:05:17Z")

</div>

i have been on aviane for three months now and i dont want to get my peruiod this month because i’ll be on vacation. will i get my period if i skip the green pills (sugar pills) or will i have side effects? i knwo [Womens Health](http://www.medicineanswers.net/womenshealth/) your not supposed to do it but ti’s only a once ina while thing like 2 or 3 times a year
