Hi,

I need to build a function that changes the playback speed of a FLV. I am trying to make it so every time you hit the "+" key the FLV plays a little faster, and when you hit the "-" key, it plays a little slower.

From what I've read, there is nothing built in. Someone suggested building a timer script to seek a frame forward or back. So, I've done that, but when I hit the keys its just creating a new timer and not killing the old on, leaving me with a bunch of timer firing off at varying times. How can I "KILL" the timer so I can create a new one with a new timerspeed?

any clues? thank you! My sorry looking code is below:



var myTimerActive:int = 0;
var videoSpeed:int = 5000;
var videoSpeedVAR:int = 10;
var timerTimes:int = 0;

// hitting + or - will call videoPlaybackTimer(fastslow)

function videoPlaybackTimer(fastslow) {

        if(fastslow == "faster"){
                videoSpeed = videoSpeed+videoSpeedVAR;
        }else{
                videoSpeed = videoSpeed-videoSpeedVAR;
        }
        videoSEEK.text = timerTimes+" / videoSpeed: "+videoSpeed;
                        
        var myTimer:Timer = new Timer(videoSpeed);                              
                        
        myTimer.addEventListener(TimerEvent.TIMER, timerHandler);

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

function timerHandler(event:TimerEvent):void {
        stream.seek(stream.time+.1);
        stream.pause();
}



--
Carl Welch
http://www.carlwelch.com
http://blog.jointjam.com
carlwelchdes...@gmail.com
805.403.4819





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

Reply via email to