Posted by: bhuvanvel | July 11, 2008

Setting the background alpha on a VideoDisplay control in Flex

Here we saw how you could modify the background color of a VideoDisplay control in Flex by setting the backgroundColor style.

The following example shows how you can set the background alpha on a Flex VideoDisplay control by setting the backgroundAlpha style.

<?xml version=”1.0″ encoding=”utf-8″?>

<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=”backgroundAlpha:”>
<mx:HSlider id=”slider”
minimum=”0.0″
maximum=”1.0″
value=”1″
snapInterval=”0.01″
liveDragging=”true” />
</mx:FormItem>
<mx:FormItem label=”backgroundColor:”>
<mx:ColorPicker id=”colorPicker” />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>

<mx:VideoDisplay id=”videoDisplay”
backgroundAlpha=”{slider.value}”
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>
courtersy: blog. Flexexamples.com

Responses

  1. hi its nice but plz help i want to alpha white color from image but not by colorfilter plz help me


Leave a response

Your response:

Categories