Flash loading external video link in loops for AS2

  • Share
  • Share

Today a client would like to create a flash banner that load external flv file and keep the video in loop. Never ending playback. This is a more or less a beginner scripts for flash. There’s much we can do for this, if anyone is more interested on this kinda topics drop me a reply I will write more about this topic.

First on the first key frame open your action panel or press F9

var url = "http://ENTER YOUR URL HERE";
var nc: NetConnection = new NetConnection();
nc.connect(null);
var ns: NetStream = new NetStream(nc);
ns.setBufferTime(5);

ns.onStatus = function(info){
	if(info.code == "NetStream.Buffer.Full"){
	}
	if(info.code == "NetStream.Buffer.Empty"){
	}
	if(info.code == "NetStream.Play.Stop"){
		ns.seek(0);
		ns.play(url);
	}
}

//video location
myVideo.attachVideo(ns);
ns.play(url);

This is the code you will need to put in your timeline.
Simply change the var url = "http://ENTER YOUR URL HERE";
Replace this with your own flv.

Related Posts Plugin for WordPress, Blogger...

I hope you have enjoyed this post, be sure to subscribe to my rss feed by click the subscribe button at the top.

Good Luck!

Be Sure to Subscribe to our feed or follow us on twitter to get the latest updates/patches
End of Article, Thanks for reading.
You can leave a response, or trackback from your own site.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

One Response to “Flash loading external video link in loops for AS2

  1. khalid says:

    hi
    thanks for the tutorial but when i uploaded to server i hear voice but no video is seen?
    what went wrong? can you help please. http://www.khalidfaisal.name/flv/fatima.flv

    thanks
    khalid

Leave a Reply