Looping FLV files with Net Stream

March 25th, 2008 by steamfrog

Whole Code:

Add a new video instance to the stage & for this example name it “videoPlayer” without the quotes.

Go to Library
vidprop0.png

Then
vidprop.png

Drag the video from the library onto the stage and give it an instance name of videoPlayer.
Add the code below on that frame.

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(ns);
ns.play(”YOUR FLV FILE LOCATION IN HERE“);
ns.onStatus = function(info) {
if (info.code == “NetStream.Play.Stop”) {
ns.seek(0);
}
};

References:
http://www.tomontheweb.ca/Blog/2006/05/looping-flv.html
http://www.quip.net/blog/2006/flash/how-to-load-external-video

Share and Enjoy:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blinkbits
  • BlinkList
  • blogmarks
  • Fark
  • Fleck
  • Furl
  • IndiaGram
  • IndianPad
  • Linkter
  • Ma.gnolia
  • NewsVine
  • Reddit
  • Simpy
  • Slashdot
  • Smarking
  • SphereIt
  • Spurl
  • StumbleUpon
  • Taggly
  • TailRank
  • Technorati
  • YahooMyWeb

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.