PDA

View Full Version : NetStream totalTime in Flash 8?


Fresh_ales
11-20-2007, 07:15 AM
Hi!
Is i was reading live docs i can see this future is available in flash 9.
so, how can i get total time of external flv file that i load/play?
I m making custom flv content player and want to make progress (play) bar and need this info to do it :P
any idea wil help!:rolleyes:

atomic
11-20-2007, 07:24 AM
onMetaData (NetStream.onMetaData handler)...

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002562.html

Fresh_ales
11-20-2007, 08:35 AM
thank you!
here is the function u use (if someone needs it sometime)

var loaded :Number = 0;
var total :Number = 0;
/*progress bar function*/
stream_ns.onMetaData = function(infoObject:Object)
{
MyDuration = infoObject["duration"];
};

_root.controlls.progress_bar.gotoAndStop(1);
onEnterFrame=function()
{
loaded = stream_ns.time;
total = MyDuration
test = Math.floor((loaded/total)*100);
trace(test);
_root.controlls.progress_bar.gotoAndStop(test);
}
/*progress bar function*/

i have aorigress_bar mc in wich i have from 1-100 frame resize my progress bar....
though have a question......
how could i make this progress bar more "smoother".. i mean the animation.... know what i mean?

atomic
11-20-2007, 02:29 PM
Not really, what do you mean?