From 551288685409d7ed560f7e84b2b2fcf04161b76c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 19 Feb 2010 22:54:17 -0500 Subject: [PATCH] custom version or 03d3 with separation of mxml/as --- 00-custom-03d3-lists/ListApp.as | 39 +++++++++++++++++++++++++++ 00-custom-03d3-lists/ListControl.mxml | 26 ++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 00-custom-03d3-lists/ListApp.as create mode 100644 00-custom-03d3-lists/ListControl.mxml diff --git a/00-custom-03d3-lists/ListApp.as b/00-custom-03d3-lists/ListApp.as new file mode 100644 index 0000000..d4cc12b --- /dev/null +++ b/00-custom-03d3-lists/ListApp.as @@ -0,0 +1,39 @@ +package +{ + import mx.core.Application; + + import mx.collections.ArrayCollection; + import mx.rpc.events.ResultEvent; + import mx.events.ListEvent; + import mx.rpc.http.HTTPService; + import mx.controls.Text; + + public class ListApp extends Application + { + [Bindable] + public var employeeList:ArrayCollection = new ArrayCollection(); + public var employeesService:HTTPService; + public var textMessage:Text; + + function ListApp() + { + } + + public function requestEmployees():void + { + employeesService.send(); + } + + public function resultHandler(event:ResultEvent):void + { + employeeList = event.result.employees.employee as ArrayCollection; + } + + public function showMessage(event:Event):void + { + textMessage.text = "You selected: " + + event.currentTarget.selectedItem.firstName + ' ' + + event.currentTarget.selectedItem.lastName; + } + } +} diff --git a/00-custom-03d3-lists/ListControl.mxml b/00-custom-03d3-lists/ListControl.mxml new file mode 100644 index 0000000..c7028e0 --- /dev/null +++ b/00-custom-03d3-lists/ListControl.mxml @@ -0,0 +1,26 @@ + + + + + + + + + + + +