Skip to content

Instantly share code, notes, and snippets.

@edeustace
Created November 26, 2010 13:47
Show Gist options
  • Save edeustace/716729 to your computer and use it in GitHub Desktop.
Save edeustace/716729 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<s:Application
minWidth="955" minHeight="600"
creationComplete="init()"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:timing="com.ee.example.timing.*">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
[Bindable]
private var countdown2:Countdown;
private function init():void
{
countdown2 = new Countdown();
countdown2.startValue = 12;
countdown2.addEventListener(Countdown.COUNTDOWN_COMPLETE, onCountdownTwoComplete);
}
private function onCountdownTwoComplete(event:Event):void
{
Alert.show("Countdown 2 complete");
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<timing:Countdown id="countdown"
startValue="10"
countdownComplete="Alert.show('countdown complete')"/>
</fx:Declarations>
<s:Label text="{countdown.value}"/>
<s:Button
label="start"
click="countdown.start()"/>
<s:Button
label="stop"
click="countdown.stop()"/>
<s:Label text="Two::::"/>
<s:Label text="{countdown2.value}"/>
<s:Button
label="start"
click="countdown2.start()"/>
<s:Button
label="stop"
click="countdown2.stop()"/>
</s:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment