-
video control
I obtained the below code from gotoandlearn.com on how to load flv files. I was wondering if anyone could show me how I would jump to a new frame after the flv finishes playing. Is this something I would use a cue point for?
Thanks very much in advance!
Code:
stop();
var video:Video = new Video(1000, 750);
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
function onStatusEvent(stat:Object):void
{
trace(stat.info.code);
}
var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
{
trace(meta.duration);
}
ns.client = meta;
video.attachNetStream(ns);
ns.play("ReaganMotion.flv");
-
Senior Member
You have several options. You can use the stat.info.code, when the player stops.
if(stat.info.code==""NetStream.Play.Stop")
{
gotoAndPlay("wherever");
}
You can use meta data when the movie finishes.
if(ns.time>=meta.duration)
{
gotoAndPlay("wherever");
}
This is when the playhead has reached the end. Just make sure that the number dimensions are the same since I am not sure.
- The right of the People to create Flash movies shall not be infringed. -
-
for some reason I cant get either to work...the top version has something wrong with the quotes.
Is there a particular place i need to insert the if statement, or can i just drop it below everything?
Thanks very much!
-
This solved my issue!
Thanks for a great start!!!
PHP Code:
ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
function netstat(stats:NetStatusEvent) { trace(stats.info.code); if (stats.info.code =="NetStream.Play.Stop") { gotoAndStop( "home" , "Scene 1"); } }
-
hello again...
So i just can't seem to get this bad boy to buffer! Any ideas for the above video loader?
Thanx
-
Senior Member
Have you tried ns.bufferTime?
- The right of the People to create Flash movies shall not be infringed. -
-
thats it...
ns.bufferTime = 5;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|