Video in Flash

Hi there.

I am working on a small flash project and i have to include some video in it.

I have managed to embed the video and play it.

The only problem is that the video is not playing smoothly, it freezes and then it speeds up!

Thats the code i am using:

var netConn = new NetConnection();
netConn.connect(null);
var netStream = new NetStream(netConn);
netStream.onStatus = function(infoObject) {
switch (infoObject.code) {
case “NetStream.Play.Stop” :
if (this.time>=this.duration-0.2) {
trace(“loop!”);
}
netStream.seek(0);
//vc.controller.oPlaypause.pause();
break;
case “NetStream.Play.Start” :
//trace(“Netstream start”);
break;
case “NetStream.Buffer.Empty” :
//vc.controller.oPlaypause.pause();
break;
case “NetStream.Buffer.Full” :
//vc.controller.oPlaypause.play();
picture._x = 700;
indicator._x = 700;
break;
}
}

netStream.onMetaData = function(infoObject) {
//trace(infoObject.duration);
//trace (obj.height);
this.duration = infoObject.duration;
}
my_video.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play(“mms.flv”);
this.createEmptyMovieClip(“flv_mc”, this.getNextHighestDepth());
flv_mc.attachAudio(netStream);
var audio_sound = new Sound(flv_mc);
audio_sound.setVolume(0);

I have tried to set different timings for the buffer but nothing changes.

If anyone knows it 'll be great.
Thanks.