Search Flex Components Free

Custom Search
Showing posts with label Media Controls. Show all posts
Showing posts with label Media Controls. Show all posts

March 24, 2008

Adding checkboxes, radiobuttons, and sub-menus to a Flex PopUpButton control’s pop up menu





<?xml version="1.0" encoding="utf-8"?>


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

layout="vertical"

verticalAlign="top"

backgroundColor="white">



<mx:Style>

PopUpButton {

popUpStyleName: myCustomPopUpStyleName;

}



.myCustomPopUpStyleName {

fontWeight: normal;

textAlign: left;

}

</mx:Style>



<mx:XML id="xmlDP">

<root>

<node label="The quick brown fox jumped over the lazy dog." />

<node label="Lorem ipsum (disabled)." enabled="false" />

<node type="separator" />

<node label="parent">

<node label="child1" />

</node>

<node label="parent (disabled)" enabled="false">

<node label="child1" />

<node label="child2" />

<node label="child3" />

</node>

<node type="separator" />

<node label="type=check" id="ch" type="check" toggled="true" />

<node label="type=check" id="ch" type="check" toggled="true" enabled="false" />

<node type="separator" />

<node label="1) type=radio" type="radio" groupName="radioGroup" toggled="true" />

<node label="2) type=radio" type="radio" groupName="radioGroup" />

<node label="3) type=radio" type="radio" groupName="radioGroup" />

<node label="4) type=radio" type="radio" groupName="radioGroup" enabled="false" />

</root>

</mx:XML>



<mx:Script>

<![CDATA[

import mx.controls.Menu;



private var menu:Menu;



private function init():void {

menu = new Menu();

menu.labelField = "@label";

menu.dataProvider = xmlDP;

menu.showRoot = false;

menu.width = popUpButton.width;

popUpButton.popUp = menu;

}

]]>

</mx:Script>



<mx:PopUpButton id="popUpButton"

label="Please select an item"

openAlways="true"

creationComplete="init();" />



</mx:Application>


December 25, 2007

Flex Media VideoDisplay with Text Synchronization Source Code


Flex Sample Source Code:

Creat a new file:

VedioDemo.mxml

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>

import mx.events.CuePointEvent;

private function cuePointHandler(event:CuePointEvent):void
{
if (event.cuePointName=="step1")
step.text="Step 1: Remove the Battery";
else if (event.cuePointName=="step2")
step.text="Step 2: Slide SIM chip into place";
else if (event.cuePointName=="step3")
step.text="Step 3: Replace the Battery";
}

</mx:Script>

<mx:Panel title="SIM Card Installation">

<mx:VideoDisplay id="video" source="../assets/phone.flv" autoPlay="false" volume=".8" cuePoint="cuePointHandler(event);">
<mx:cuePoints>
<mx:Array>
<mx:Object name="step1" time="2"/>
<mx:Object name="step2" time="5"/>
<mx:Object name="step3" time="10"/>
</mx:Array>
</mx:cuePoints>
</mx:VideoDisplay>

<mx:ControlBar>
<mx:Button label="Play" click="video.play()" toggle="true" selected="{video.playing}" enabled="{!video.playing}"/>
<mx:Button label="Pause" click="video.pause()" toggle="true" enabled="{video.playing}"/>
<mx:Button label="Stop" click="video.stop()" enabled="{video.playing}"/>
</mx:ControlBar>

</mx:Panel>

<mx:Label id="step" fontSize="20" width="100%" textAlign="center"/>

</mx:Application>

Flex Media Image Source Code

Flex Sample Source Code:

Creat a New File :
ImageDemo.mxml

---------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">

<mx:HBox horizontalGap="50">

<mx:VBox width="100%" height="100%" horizontalAlign="center">
<mx:Label text="This image was embedded in the SWF"/>
<mx:Image source="@Embed('../assets/products/Nokia_6630.png')"/>
</mx:VBox>

<mx:VBox width="100%" height="100%" horizontalAlign="center">
<mx:Label text="This image was loaded dynamically"/>
<mx:Image source="../assets/products/Siemens_SX1.png"/>
</mx:VBox>

</mx:HBox>

</mx:Application>

Related Flex Tutorials