Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : really need help with netstream


Alwinch
11/22/2006 10:37:54 PM
Hi...need some advice on things I can't seem to grasp

Can it seem to get a working AS on a button or event to unload a imported
FLV

tried
ns.Close();

and this jsut stops the playhead. Doens't unload the movie
also tried.
ns.play("");

to no avail.

Also is there a way to know when the flv is finshed playing so I can key an
event without cue points in the video? tried this as well...

if(info.code == "NetStream.Play.Stop") {
ns.play("");


thanks for any help.

th3_j0ker
11/23/2006 12:58:55 AM
netStream.play("film.flv");
netStream.pause();
netStream.close();

should work!
---

// for looping:
netStream.onStatus = function(obj) {

if (obj.code == "NetStream.Play.Stop") {
trace ("looping, STATUS: "+obj.code);
_level0.netStream.seek(0);
}
}


have phun!
michael
LuigiL
11/23/2006 3:24:50 PM
Assuming:
-you are using the Video Class
-the instance of the Video Object on the stage is called my_video:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("yourflv.flv");
stream_ns.onStatus = function(infoObject:Object) {
if(infoObject.code=="NetStream.Buffer.Empty"){//reached the end, stopped and
cleared the stream
trace("The video stopped.");
my_video._visible=false;
}
};
You cannot unload the video. It is in the cache. With Communication Server,
you can.
AddThis Social Bookmark Button