FLEX no.4
-----------------ex4_01_solution------------------Creating an event and dispatching the event object
<s:Application ...
creationComplete="employeeService.send()">
»á´¥·¢£º
<!-- Declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<fx:Declarations>
<s:HTTPService id="employeeService"
url="data/employees.xml"
result="employeeService_resultHandler(event)" />
</fx:Declarations>
protected function employeeService_resultHandler(event:ResultEvent):void
{
employeeData = event.result.employees.employee;
}
UI×é¼þ£º
<s:HGroup gap="30">
<components:Choose id="chooseEmployee"
employeeData="{employeeData}"
x="30" y="90"
showPreview="chooseEmployee_showPreviewHandler(event)"/>
<components:Preview id="previewEmployeeOfTheMonth"
title="Employee of the Month"
&
Ïà¹ØÎĵµ£º
Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:file="file.*">
<mx:Script>
<!--[CDATA[
import simPager.PagerEvent;
import mx.collections.ArrayCollection;
[Bindable]
priv ......
ʹÓÃjsÀ´²Ù×÷flex
Ê×ÏÈÔÚfademo.mxmlÖÐÉùÃ÷Ò»¸öbutton£¬²¢Ìí¼ÓÒ»¸öbtnClick·½·¨£º
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="l ......
/*============ʹÓÃ==========*/
var contextmenu:ContextMenuManager=new ContextMenuManager();
contextmenu.add("×î´ó»¯",menuHandle);//menuHandle´¦Àíº¯Êý
/**==================ContextMenuManager.as==========================*/
package file
{
import flash.display.Interact ......
¸ÅÊö
ÓÎÏ·¿ª·¢ÊǸöºÜ´óµÄ¿ÎÌ⣬¸ÃϵÁÐÖ»¼òµ¥½²ÊöÈçºÎʹÓÃFlex¼¼Êõƽ̨´î½¨Ò»¸ö¼òµ¥µÄÓÎÏ·¿ò¼Ü£¬ÈçºÎÉè¼ÆÄÜÓÅ»¯ÓÎÏ·µÄCPUÕ¼Óã¬ÄÚ´æµÈ£¬×îºóÖÆ×÷Ò»¸öÍêÕûµÄFlexСÓÎÏ·(ÌṩԴÂë)¡£
ÓÎÏ·µÄ³ÊÏÖ
·½Ê½1£ºÔª¼þ·½Ê½
ÕâÖÖ·½Ê½±È½ÏÊʺÏСÐ͵ÄÓÎÏ·£¬ÓÎÏ·Ôª¼þÊýÁ¿ÉÙµÄÇé¿ö¡£µ±ÓÎÏ·Ôª¼þÊýÁ¿´óʱ¾Í²»ºÏÊÊÁË£ºÔª¼þ»á¶ÔÓÎϷͼÐΡ¢ÒôÆ ......