In a recent Flash project, while working with the FLV video, there was requirement to change the playback of flv video to different speeds on user selection. I achieved this by changing the stage frame rate of the Flash movie. Following steps will explain how can you replicate that:
- Create a MovieClip symbol and place flv video on enough frames to play it completely.
- Open Components panel and drag radio button from UI folder.
- Set the groupname of radio button to “videoSpeed”, set its value to “30” and label to “Actual”. Using Properties panel, give it instance name “btnActual”
- Repeat the above step and drag two more radion buttons. Their groupname will be same “videoSpeed”. Set their values to “15” and “5” and labels to “15fps” and “5fps” respectively. Using the Properties panel, give them instance names “btn15” and “btn5” respectively.
- You are all set on stage.
Now open the Actions Panel on frame 1 and add following code:
//set your framerate here whatever you want stage.frameRate = 30; var FRAMERATE : Number = stage.frameRate; btnActual.addEventListener(MouseEvent.CLICK, videoSpeed); btn15.addEventListener(MouseEvent.CLICK, videoSpeed); btn5.addEventListener(MouseEvent.CLICK, videoSpeed); function videoSpeed (myEvent:Event):void{ var newFrameRate = Number(myEvent.target.value); stage.frameRate = newFrameRate; }
Hope that helps.
Cheers!