Hi,

If you remove the timer listener, stop the timer and make your timer a variable outside your function, you can recreate a new one... The key is removing the event listener before you "kill" the timer instance - it's good practice, especially for AS3 :)

   See the code below - it was not too bad!
I am not sure how easy it is to skip through the FLV - it looks possible, but might end up looking funny - the problem being is that you are trying to play an FLV, but also asking it to seek - you will need to make sure that your "pause()" does not stop it from playing too. Because of the encoding of FLV's using keyframes in inbetween frames, you might end up with funny looking results, but it could work - don't know.

   HTH

   Glen
//Put your timer variable outside the function. If you are coding on a frame in Flash, make sure you have a "stop()" at the end of the code.
var myTimer:Timer = null;

function videoPlaybackTimer(fastslow) {

   if(fastslow == "faster"){
       videoSpeed = videoSpeed+videoSpeedVAR;
   }else{
       videoSpeed = videoSpeed-videoSpeedVAR;
   }
   videoSEEK.text = timerTimes+" / videoSpeed: "+videoSpeed;
//Add a check to see if you have a timer already:
   if(null != myTimer) {
      myTimer.removeEventListener(TimerEvent.TIMER, timerHandler);
      myTimer = null;
   }
//Then you can safely create a new Timer and not worry about the old one... myTimer = new Timer(videoSpeed); myTimer.addEventListener(TimerEvent.TIMER, timerHandler);

   myTimerActive = 1;
   myTimer.start();
   timerTimes++
}

--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to