/////////only name and roomsize dataField access from XML file//////////////
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="init()" width="100%" height="100%" pageTitle="Employee Directory"
backgroundGradientColors="[0x000000,0x323232]">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var employeeData:ArrayCollection=new ArrayCollection();
private function resultHandler(event:ResultEvent):void
{
employeeData=event.result.rooms.room;
}
private function faultHandler(event:FaultEvent):void
{
Alert.show("what are you doing");
}
public function init():void
{
employeeService.send();
}
]]>
</mx:Script>
<mx:HTTPService id="employeeService"
url="data/roomList.xml" result="resultHandler(event)"
fault="faultHandler(event)"/>
<mx:TextInput x="295" y="73" id="keyword"/>
<mx:Button x="479.5" y="73" label="Search"/>
<mx:Canvas x="295" y="103" width="249.5" height="235">
<mx:Image x="10" y="10"/>
<mx:Label x="125" y="10" text="Patricia Dension"/>
<mx:Label x="125" y="36" text="Vice President"/>
</mx:Canvas>
<mx:Panel x="28" y="103" width="250" height="235" layout="absolute" title="RoomsDetail">
<mx:AdvancedDataGrid x="0" y="0" id="adg1" designViewDataType="flat"
dataProvider="{employeeData}" width="230" height="195"
textRollOverColor="green" textSelectedColor="red">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="RoomName" dataField="name"/>
<mx:AdvancedDataGridColumn headerText="RoomSize" dataField="roomsize"/>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Panel>
</mx:Application>
///////////////XML FILE data in your SRC src/Data/roomList.xml folder//////////////////
<rooms>
<room>
<name>Colorado Room</name>
<roomsize>20x20</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>150</capacity><windows>South wall all glass, garden view</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>5</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>15</maxroundtables>
<maxsquaretables>10</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Mile High Room</name>
<roomsize>25x30</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>100</capacity>
<windows>One window, north wall</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>3</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>10</maxroundtables>
<maxsquaretables>8</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Bronco Room</name>
<roomsize>15x13</roomsize>
<cateringservice>No</cateringservice>
<restroomlocation>Eastside near elevator</restroomlocation>
<capacity>75</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>4</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Seminar</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>8</maxroundtables>
<maxsquaretables>6</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Greeley Room</name>
<roomsize>20x20</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>150</capacity>
<windows>South wall all glass, garden view</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>1</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes><maxroundtables>15</maxroundtables>
<maxsquaretables>10</maxsquaretables>
<roomimage>conference.jpg</roomimage>
</room>
<room>
<name>Boulder Room</name>
<roomsize>40x40</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>350</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>3</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>35</maxroundtables>
<maxsquaretables>30</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Denver Room</name>
<roomsize>10x10</roomsize>
<cateringservice>No</cateringservice>
<restroomlocation>Southside near stairs</restroomlocation>
<capacity>10</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>2</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Meeting</event>
<event>Seminar</event></eventtypes>
<maxroundtables>1</maxroundtables>
<maxsquaretables>1</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
</rooms>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="init()" width="100%" height="100%" pageTitle="Employee Directory"
backgroundGradientColors="[0x000000,0x323232]">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var employeeData:ArrayCollection=new ArrayCollection();
private function resultHandler(event:ResultEvent):void
{
employeeData=event.result.rooms.room;
}
private function faultHandler(event:FaultEvent):void
{
Alert.show("what are you doing");
}
public function init():void
{
employeeService.send();
}
]]>
</mx:Script>
<mx:HTTPService id="employeeService"
url="data/roomList.xml" result="resultHandler(event)"
fault="faultHandler(event)"/>
<mx:TextInput x="295" y="73" id="keyword"/>
<mx:Button x="479.5" y="73" label="Search"/>
<mx:Canvas x="295" y="103" width="249.5" height="235">
<mx:Image x="10" y="10"/>
<mx:Label x="125" y="10" text="Patricia Dension"/>
<mx:Label x="125" y="36" text="Vice President"/>
</mx:Canvas>
<mx:Panel x="28" y="103" width="250" height="235" layout="absolute" title="RoomsDetail">
<mx:AdvancedDataGrid x="0" y="0" id="adg1" designViewDataType="flat"
dataProvider="{employeeData}" width="230" height="195"
textRollOverColor="green" textSelectedColor="red">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="RoomName" dataField="name"/>
<mx:AdvancedDataGridColumn headerText="RoomSize" dataField="roomsize"/>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Panel>
</mx:Application>
///////////////XML FILE data in your SRC src/Data/roomList.xml folder//////////////////
<rooms>
<room>
<name>Colorado Room</name>
<roomsize>20x20</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>150</capacity><windows>South wall all glass, garden view</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>5</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>15</maxroundtables>
<maxsquaretables>10</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Mile High Room</name>
<roomsize>25x30</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>100</capacity>
<windows>One window, north wall</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>3</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>10</maxroundtables>
<maxsquaretables>8</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Bronco Room</name>
<roomsize>15x13</roomsize>
<cateringservice>No</cateringservice>
<restroomlocation>Eastside near elevator</restroomlocation>
<capacity>75</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>4</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Seminar</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>8</maxroundtables>
<maxsquaretables>6</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Greeley Room</name>
<roomsize>20x20</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>150</capacity>
<windows>South wall all glass, garden view</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>1</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes><maxroundtables>15</maxroundtables>
<maxsquaretables>10</maxsquaretables>
<roomimage>conference.jpg</roomimage>
</room>
<room>
<name>Boulder Room</name>
<roomsize>40x40</roomsize>
<cateringservice>Yes</cateringservice>
<restroomlocation>Westside near elevator</restroomlocation>
<capacity>350</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>3</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Wedding</event>
<event>Seminar</event>
<event>Conference</event>
<event>Dinner Party</event>
<event>Dance</event>
<event>Meeting</event></eventtypes>
<maxroundtables>35</maxroundtables>
<maxsquaretables>30</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
<room>
<name>Denver Room</name>
<roomsize>10x10</roomsize>
<cateringservice>No</cateringservice>
<restroomlocation>Southside near stairs</restroomlocation>
<capacity>10</capacity>
<windows>None</windows>
<wheelchair_accessible>Yes</wheelchair_accessible>
<description>The Colorado Room is a comfortable room for any type of event. It is a popular room so book now!</description>
<stars>2</stars>
<publictelephone_location>Entry level: North wall</publictelephone_location>
<eventtypes><event>Meeting</event>
<event>Seminar</event></eventtypes>
<maxroundtables>1</maxroundtables>
<maxsquaretables>1</maxsquaretables>
<roomimage>conference.jpg</roomimage></room>
</rooms>