FLEX: videoDisplay.addEventListener(VideoEvent.PLAYHEAD_UPDATE) doesn't work
- by Patrick
hi,
the PLAYHEAD_UPDATE event is not triggered by my videoDisplay component in Flex.
If I add the attribute playheadUpdate="playUpdate()" everything works fine.
But in the following code, the method "playUpdate()" is not triggered... thanks
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
<mx:Script><![CDATA[
import mx.events.VideoEvent
private function init():void {
...
videoD.addEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate);
}
private function thumbPressed():void {
videoD.removeEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate);
}
private function thumbReleased():void {
videoD.addEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate);
}
private function playUpdate():void {
debugF.text = "OK";
slider.value = videoD.playheadTime;
}
]]></mx:Script>
<mx:VideoDisplay id="videoD" autoPlay="{autoPlayOption}" source="{videoPath}" click="togglePlay()" />
The text OK is not displayed, and the slider is not updated. As I mentioned before, adding the attribute in MXML, works, instead.