View Full Version : OnVideoComplete?
waffe
June 24th, 2007, 04:52 AM
Hi,
I am trying to run a function once a video file completes but I cannot figure it out. I have been using onPlayStatus in many different ways but nothing seems to work.
I have a netStream video playing, once this video is done playing how do you trigger a function ?
Thanks as always,
waffe
ittn15
June 24th, 2007, 09:03 AM
you can handle the event use the key words ' NetStream.Play.Complete' as following
private function netStatusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Play.Complete":
trace("Stream Complete: " + videoURL);
break;
}
}
serach 'NetStream' in flash help document for more details:hr:
waffe
June 25th, 2007, 12:43 AM
Thanks ittn15 for the words of wisdom especially coming from someone who answered my question with their first post! :beam:
Ya I use the flash lib all the time but this time I could not figure it out. Thanks again, I will try what you posted.
waffe
waffe
June 25th, 2007, 01:25 AM
Damn it, I still seem to be missing it!! Basically I have already done what you posted, just didn't see it until I tried it.
I have a function:
function netStatusHandler(event:NetStatusEvent):void {}
This function has your code in it. But the case statement never runs.
Question:
what does the addEventListener look like that calls this function?
The one I have set up looks like this:
aNC[i].addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
So I believe what I am missing is the NetStatusEvent.NET_STATUS argument should be something different - but what?
thanks again,
waffe
ittn15
June 25th, 2007, 04:40 AM
'aNC[i].addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);'
pay attention to 'aNC[i]', did you use netConnection to dispatch netStream's event?
sorry for my poor eng.....
waffe
June 26th, 2007, 12:48 AM
Thanks ittn15 - it works!!! the code you posted did work I just had some other code that was stopping it from working correctly.
Thanks again,
waffe
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.