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…
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
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…
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…