<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2006 Renaun Erickson (http://renaun.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ignore
-->
<!--

This is an example excerise in Object composition

-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    backgroundColor="0xFFFFFF"
    xmlns:car="com.renaun.objects.*" viewSourceURL="srcview/index.html">
    <mx:Script>
        <![CDATA[
            import com.renaun.objects.CarMonitorEvent;
            [Bindable]
            public var console:String = "";
        ]]>
    </mx:Script>
    <car:Car id="myCar" source="@Embed(source='truck.jpg')"
        TurnLeft="console += 'Turning Left Now!\n';"
        TurnRight="console += 'Turning Left Now!\n';"
        CarMonitor="console += CarMonitorEvent( event ).message + '\n';" />
    
    <mx:HBox>
        <mx:Button label="Start the Truck" click="console += 'Turning Key On!\n';myCar.turnKey( true )" enabled="{ !myCar.isRunning }" />
        <mx:Button label="Stop the Truck" click="console += 'Turning Key Off!\n';myCar.turnKey( false )" enabled="{ myCar.isRunning }" />
        <mx:Button label="Put into Drive" click="console += 'Put into Drive!\n';myCar.putIntoDrive()" enabled="{ myCar.isRunning }"/>    
    </mx:HBox>
    
    <mx:TextArea text="{ console }" width="600" height="300"/>
    
    <mx:Label color="0x777777" text="More Flex By Example by Renaun Erickson located at http://renaun.com/flex2/" />
    <mx:Label color="0x777777" text="Image from http://jeep.com" />
</mx:Application>