Ocean’s Eleven

var $Casino:MovieClip = new MovieClip();
$Casino.title = "Ocean's Eleven";

stage.quality = StageQuality.BEST;
stage.addChild($Casino);

var Prize:Object = {name:"Julia Roberts",value:10};
var Thieves:Array = ["Clooney","Pit","Cheadle"];
var Mood:Array = ["Happy","Angry","Mad","Furious"];
var count:uint = 0;

var Time:Timer = new Timer(Prize.value*100,Thieves.length);
Time.addEventListener(TimerEvent.TIMER,getTheMoney);
Time.addEventListener(TimerEvent.TIMER_COMPLETE,getTheGirl);

function getTheMoney(e:TimerEvent):void{
    try{
        trace(triggerAlarm(willTrigger(evt.type)) + " & " + seeAndys(Mood[count++]));
    }
    catch(e:Error){
        trace(triggerAlarm(true));
    }
}

function getTheGirl(e:TimerEvent):void{
    trace(Thieves[0] + " gets " + Prize.name);
}

function seeAndys(n:String = "OK"):String{
    return "Andy Garcia is " + n;
}

function triggerAlarm(n:Boolean = true):String{
    return "Alarm triggers: " + (n.toString());
}

trace(seeAndys(Mood[count++]));
Time.start();
Vote up this code0