All pastes #161896 Raw Edit

Something

public text v1 · immutable
·published 2006-09-05 22:21 UTC
rendered paste body
var listenerScrub:Object = new Object();

listenerScrub.scrubFinish = function(e:Object):Void {
var tofind = Math.floor(e.playheadTime*1000);
var percent_time = ((e.playheadTime*1000) / _root.duration)*100;
var percent_bytes = (_root.flv_cmp.bytesLoaded / _root.flv_cmp.bytesTotal)*100;

if(percent_time > percent_bytes){
 for (var i:Number=0; i < _root.times.length; i++){
  var j = i + 1;
  if( (_root.times[i] <= tofind) && (_root.times[j] >= tofind ) ){
   _root.flv_cmp.stop(); 
   player.loadMedia( _phpURL + "?file=" + _vidName + "&to=" + _root.positions[i]); 
   break;
  }}}};

_root.flv_cmp.addEventListener("scrubFinish", listenerScrub);