We wanted to share with you a great video tutorial about how to use Adobe Flash Catalyst and create Flex Applications starting just with an image.
The tutorial explains in details how you can create a Flex button and a scrollbar using Catalyst.
The following example shows how you can display a video using the chromeless VideoElement control in Flex Gumbo.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/05/14/displaying-a-video-using-the-videoelement-control-in-flex-gumbo/ -->
<s:Application name="Spark_VideoElement_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
<mx:ApplicationControlBar width="100%" cornerRadius="0">
<s:Button id="playBtn"
label="play"
click="videoElement.play();" />
<s:Button id="pauseBtn"
label="pause"
click="videoElement.pause();" />
<s:Button id="stopBtn"
label="stop"
click="videoElement.stop();" />
<s:CheckBox id="mutedCheckBox"
label="muted"
selected="true"
click="videoElement.muted = mutedCheckBox.selected;" />
<s:Graphic>
<s:SimpleText id="playheadTimeLabel"
text="{videoElement.playheadTime.toFixed(3)}" />
</s:Graphic>
</mx:ApplicationControlBar>
<s:Group horizontalCenter="0" verticalCenter="0">
<s:VideoElement id="videoElement"
autoRewind="true"
source="http://helpexamples.com/flash/video/cuepoints.flv"
muted="true"/>
</s:Group>
</s:Application>
The following example shows how you can toggle smoothing on a Spark VideoPlayer object in Flex Gumbo by setting the Boolean smoothing property on the VideoPlayer object’s internal videoObject property.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/05/24/toggling-smoothing-on-a-spark-videoplayer-object-in-flex-gumbo/ -->
<s:Application name="Spark_VideoPlayer_VideoElement_videoObject_smoothing_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
<fx:Script>
<![CDATA[
private function checkBox_change(evt:Event):void {
videoPlayer.videoElement.videoObject.smoothing = checkBox.selected;
}
]]>
</fx:Script>
<s:CheckBox id="checkBox"
label="smoothing"
left="10"
top="10"
change="checkBox_change(event);" />
<s:Panel id="panel"
title="{videoPlayer.source}"
horizontalCenter="0"
verticalCenter="0">
<s:VideoPlayer id="videoPlayer"
source="http://helpexamples.com/flash/video/water.flv"
muted="true" />
</s:Panel>
</s:Application>