Video Creating Using NetStream

Three Classes to control video with actionscripts.

  1. Net Connection
  2. Netstream
  3. Video

Type of cuepoints

1.Navigation
2.Event
3. Frame accurate
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
ns.client= this;
ns.play(“1254014.flv”);

function onMetaData(info:Object):void
{
trace(“Receving…”);
}

var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid.x=10;
vid.y=10;

play_btn.addEventListener(MouseEvent.CLICK,playHandler);
stop_btn.addEventListener(MouseEvent.CLICK,stopHandler);
pause_btn.addEventListener(MouseEvent.CLICK,pauseHandler);

function playHandler(e:MouseEvent):void
{
ns.resume();
}

function stopHandler(e:MouseEvent):void
{
ns.pause();
ns.seek(0);
}

function pauseHandler(e:MouseEvent):void
{
ns.pause();
}

Advertisements

Posted on December 2, 2009, in Flash and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: