rendered paste body<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.ListEvent;
import mx.effects.Move;
[Bindable]
private var patients:ArrayCollection = new ArrayCollection([
{OR:"X", Time:"10:34 AM", Patient:"Anthony", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"John", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Larry", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Moe", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Bob", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Mary", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Katie", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Fonze", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Frank", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Susan", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"}
]);
private var ticker:Timer;
private var currentTime:Date;
public function setup():void {
// creates a Timer that fires an event once per second
ticker = new Timer(1000);
// designates the onTick() method to handle Timer events
ticker.addEventListener(TimerEvent.TIMER, onTick);
// starts the clock ticking
ticker.start();
//this.mode1.addEventListener(MouseEvent.CLICK, rowClick);
//this.addEventListener(MouseEvent.ROLL_OVER, prescolor);
}
public function onTick(event:TimerEvent):void
{
currentTime = new Date();
var seconds:uint = currentTime.getSeconds();
var minutes:uint = currentTime.getMinutes();
var hours:uint = currentTime.getHours();
this.clock.headerText = "Time: " + timeFormatter.format(currentTime);
this.date.headerText = dateFormatter.format(currentTime);
}
private function rowClick(event:ListEvent):void
{
//Alert.show("I believe you wanted information about " + patients[event.rowIndex.toString()].Patient);
var effectout:Move;
var effectin:Move;
effectout = new Move();
effectin = new Move();
effectout.duration = 1500;
effectout.target = mode1cont;
effectout.xBy = 5000;
effectin.duration = 1500;
effectin.target = mode2cont;
effectin.xBy = 1500;
//this.mode1cont.visible = false;
this.mode2cont.visible = true;
effectout.play();
effectin.play();
}
]]>
</mx:Script>
<mx:DateFormatter id="dateFormatter" formatString="EEEE, MMM. D, YYYY"/>
<mx:DateFormatter id="timeFormatter" formatString="H:NN:SS A"/>
<mx:Panel title="Operating Room Schedule" id="mode1cont" height="100%" width="100%" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" layout="absolute">
<mx:AdvancedDataGrid width="100%" height="100%" id="mode1" dataProvider="{patients}" fontSize="15" initialize="setup()" selectionMode="singleRow" itemClick="rowClick(event)">
<mx:groupedColumns>
<mx:AdvancedDataGridColumnGroup id="hospname" fontSize="20" headerText="Lawrence Memorial Hospital">
<mx:AdvancedDataGridColumn width="15" resizable="false" sortable="false" dataField="OR"/>
<mx:AdvancedDataGridColumn width="35" resizable="false" sortable="false" dataField="Time"/>
<mx:AdvancedDataGridColumn width="75" resizable="false" sortable="false" dataField="Patient"/>
<mx:AdvancedDataGridColumn width="30" resizable="false" sortable="false" dataField="PTRM" headerText="PT. RM."/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup id="clock" fontSize="20">
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Surgeon"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Attending"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="ANESType" headerText="ANES Type"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup id="date" fontSize="20">
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Procedure"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Remarks"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Anesthetist"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="R.N."/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Scrub"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Circ."/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</mx:Panel>
<mx:Panel title="Patient Breakdown" id="mode2cont" height="100%" width="100%" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" layout="absolute" x="-1505" y="5">
<mx:Label text="Dr. Arvan Agah" x="5" y="5"/>
<mx:Image source="../agah_color.jpg" width="77" height="101" x="5" y="29"/>
</mx:Panel>
</mx:Application>