The following example shows how you can modify the background color of a Flex VideoDisplay control by setting the backgroundColor style.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
private function loadButton_click(evt:MouseEvent):void {
var url:String = "http://www.helpexamples.com/flash/video/clouds.flv";
videoDisplay.source = url;
}
private function unloadButton_click(evt:MouseEvent):void {
videoDisplay.close();
videoDisplay.source = null;
videoDisplay.mx_internal::videoPlayer.clear();
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="backgroundColor:">
<mx:ColorPicker id="colorPicker" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:VideoDisplay id="videoDisplay"
backgroundColor="{colorPicker.selectedColor}"
width="160"
height="120" />
<mx:ControlBar>
<mx:Button id="loadButton"
label="Load"
click="loadButton_click(event);" />
<mx:Button id="unloadButton"
label="Unload"
click="unloadButton_click(event);" />
</mx:ControlBar>
</mx:Application>
View source is enabled in the following example.
You can also set the backgroundColor style in an external .CSS file or in an <mx:Style /> block, as seen in the following snippet:
<mx:Style>
VideoDisplay {
backgroundColor: red;
}
</mx:Style>
Or, you could set the backgroundColor style using ActionScript, as seen in the following snippet:
videoDisplay.setStyle("backgroundColor", "red");





he-he..
Nice :)