handler(s)
private function toggle():void {
try {
switch (systemManager.stage.displayState) {
case StageDisplayState.FULL_SCREEN:
systemManager.stage.displayState = StageDisplayState.NORMAL;
break;
default: systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
} catch (err:SecurityError) {
// ignore
}
}
video(s)
[Bindable]
private var index:uint = 0;
private var max:uint = 4;
public var video:Array = [
"../assets/clips/blip/rgbxyz.flv",
"../assets/clips/shout/strangest.flv",
"../assets/clips/tube/baby-laugh.flv",
"../assets/clips/tube/strings.flv"
];
[Bindable]
public var source:String = video[index];
click
private function click ( event:MouseEvent ):void
{
index += 1; if (index > (max-1)) index = 0;
myVid.stop();
source = video[index]; // bindable
myVid.play();
}
]]>
</mx:Script>
display
<mx:VideoDisplay id="myVid" source="{source}" height="100%" width="100%" autoPlay="false"/>
<mx:Label text="{index}" color="white" top="10" right="20"/>
controls
<mx:HBox left="20" bottom="10">
<mx:Button color="white" right="20" borderColor="0" fillAlphas="[0, 0]" label="!" click="click(event);"/>
</mx:HBox>
<mx:HBox right="20" bottom="10">
<mx:Button color="gray" borderColor="0" fillAlphas="[0, 0]" label=">" click="myVid.play();"/>
<mx:Button color="gray" borderColor="0" fillAlphas="[0, 0]" label="||" click="myVid.pause();"/>
<mx:Button color="gray" borderColor="0" fillAlphas="[0, 0]" label="_" click="myVid.stop();"/>
<mx:Button color="gray" borderColor="0" fillAlphas="[0, 0]" label="full" click="toggle();"/>
</mx:HBox>
</mx:Application>