Yes, I need to use you guys as a sounding board once more :-)
I have a button that has two listeners one for mouse up and the other for mouse down and they point to the same function.
Expand|Select|Wrap|Line Numbers
- $btnRewind.addEventListener(MouseEvent.MOUSE_DOWN,onBtnBack);
- $btnRewind.addEventListener(MouseEvent.MOUSE_UP,onBtnBack);
As you can see by the code below, I've been trying a ton of stuff and I've commented out all the stuff that I'm not currently using
Expand|Select|Wrap|Line Numbers
- private function onBtnBack(event:MouseEvent) : void
- {
- myCurrentPlayHead = Number($video.time);
- //trace("$video.timecode "+$video.timecode);
- //trace("$video.time "+$video.time);
- //trace("event "+event);
- //trace("myCurrentPlayHead "+myCurrentPlayHead);
- //myConvertTime = String($video.timecode);
- //myConvertTimeArray = myConvertTime.split(/:/);
- //myCounterSec = Number(myConvertTimeArray[2]);
- //myCounterFrames = Number(myConvertTimeArray[3]);
- //myActualSeconds = myCounterSec * $video.fps;
- //myActualFrames = myActualSeconds + myCounterFrames;
- //trace("myActualFrames "+myActualFrames);
- //myEndTime = Number($video.stream_end_time);
- //trace("myEndTime "+myEndTime);
- while(myCurrentPlayHead>0 && event.type == "mouseDown")
- {
- if(event.type == "mouseUp")
- {
- break;
- }
- else
- {
- myCurrentPlayHead = myCurrentPlayHead - 0.05;
- trace("myCurrentPlayHead rwnd "+myCurrentPlayHead);
- my_timedProcess = setTimeout(my_rewindFunction,1000/$video.fps);
- }
- }
- }
- public function my_rewindFunction():void
- {
- if(myCurrentPlayHead > 0)
- {
- $video.pause();
- $video.seek(myCurrentPlayHead);
- }
- }
BTW, speaking of infinite loops, I am tracing the var myCurrentPlayHead and it always goes below 0 into negative numbers, but the while loop still doesn't break.
Please help, I'm at a loss -- this should work.
Thanx n advance