FlashComGuru Home InfluxisCDNImediaseeUvault
                                                                                       Forum Index | Active Topics | Register
                                                                                                          List Overview | List Archives
                                                                                                                           About this site | Advertise
 

home

Adobe AIR (11)
Applications (40)
Books & Training (11)
Collaboration (18)
Components (10)
Events (80)
Flash Player (35)
Flex (39)
FMS (110)
General (123)
Hosting (6)
Jobs (17)
Off topic (36)
OSMF (3)
Press Releases (23)
Site Check (11)
Tools (53)
Videos & Players (74)

Follow me on Twitter

 
If you are using the FLVPlayback component in combination with a custom UI seekbar component then you may have asked yourself why the seekbar is not clickable. Many video players implement this functionality: rather than having to find the handle, drag it and let go it is possible to click the seekbar anywhere to jump to that point.

Fortunately it is ot too difficult to add this piece of behaviour. The following code is applicable to an instance of the FLVPlayback component on stage (instance name 'player') not using a skin but using a custom UI seekbar component (instance name 'seekbar').

player.seekBar = seekb;

seekb.addEventListener( MouseEvent.MOUSE_DOWN, onclick);

seekb.useHandCursor = true;
seekb.buttonMode = true;

function onclick(e:MouseEvent):void
{   
   var seekto = ((this.mouseX-seekb.x)/seekb.width)*100;
   trace(seekto);
   player.playheadPercentage = seekto;
}

Give that a try and you should be able to click the seekbar to jump to any point in the video (provided you are streaming or - if using progressive download - the video has already loaded up to the part you are trying to seek to).

Comments
[Add Comment]
Stefan,

Feel free to file this as an enhancement request if you think we should add it to the UI.

- brad
# Posted By Brad | 8/25/08 9:57 PM
clear explanation. thanks!
# Posted By maysun | 8/26/08 1:32 PM