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 @@ + + + + + + + + + + + +