You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

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;
}
}
}