
layout="vertical">
<mx:Script>
<![CDATA[
private var cues:Array = [
{ start: 0.0, stop: 1.0, text:'Megan' },
{ start: 4.0, stop: 7.0, text:'Swinging' }
];
public function updateUI() : void {
btnPlay.label = ( cntlDisp.playing ) ? 'Pause' : 'Play';
var found:Boolean = false;
for each ( var cue:Object in cues ) {
if ( cntlDisp.playheadTime.valueOf() >= cue.start &&
cntlDisp.playheadTime.valueOf() <= cue.stop )
{
found = true;
txtCueText.text = cue.text;
cnvTextArea.visible = true;
}
}
if ( !found )
cnvTextArea.visible = false;
}
public function onReady() : void {
cntlDisp.play();
updateUI();
}
public function onPlay() : void {
if ( cntlDisp.playing ) cntlDisp.pause();
else cntlDisp.play();
updateUI();
}
]]>
</mx:Script>
<mx:Canvas width="400" height="300">
<mx:VideoDisplay id="cntlDisp" source="http://localhost
/megan2.flv" width="400"
height="300" playheadUpdate="updateUI()" autoPlay="false"
playheadUpdateInterval="150"
ready="onReady()" live="false" />
<mx:Canvas id="cnvTextArea" width="400" height="30"
backgroundAlpha="0.6"
backgroundColor="black" top="270" visible="false">
<mx:Text id="txtCueText" color="white" fontSize="18"
fontWeight="bold" text="" />
</mx:Canvas>
98 | Chapter 6: More Flex Applications
Kommentare zu diesen Handbüchern