
layout="vertical">
<mx:Script>
<![CDATA[
public function updateUI() : void {
btnPlay.label = ( cntlDisp.playing ) ? 'Pause' : 'Play';
sldCuePoint.value = cntlDisp.playheadTime;
}
public function onReady() : void {
sldCuePoint.maximum = cntlDisp.totalTime;
cntlDisp.play();
updateUI();
}
public function onCueThumbPress( event:Event ) : void {
cntlDisp.pause();
}
public function onCueThumbRelease( event:Event ) : void {
cntlDisp.playheadTime = event.currentTarget.value;
}
public function onPlay() : void {
if ( cntlDisp.playing ) cntlDisp.pause();
else cntlDisp.play();
updateUI();
}
]]>
</mx:Script>
<mx:VideoDisplay id="cntlDisp" source="http://localhost
/megan2.flv" width="400"
height="300"
playheadUpdate="updateUI()" autoPlay="false"
playheadUpdateInterval="150"
ready="onReady()"
live="false" rotation="-5">
<mx:filters>
<mx:GlowFilter />
<mx:DropShadowFilter />
</mx:filters>
</mx:VideoDisplay>
<mx:HBox>
<mx:Button id="btnPlay" label="Pause" click="onPlay()" />
<mx:Button label="Rewind" click="{cntlDisp.playheadTime =
0;}" />
<mx:HSlider id="sldCuePoint" liveDragging="true"
allowTrackClick="false"
thumbPress="onCueThumbPress(event);"
thumbRelease="onCueThumbRelease(event);" />
</mx:HBox>
</mx:Application>
96 | Chapter 6: More Flex Applications
Kommentare zu diesen Handbüchern