Flex×Ô¶¨Òå×é¼þÓë×Ô¶¨Òåʼþ
1¡¢×Ô¶¨Òå×é¼þ
2¡¢×Ô¶¨Òåʼþ
3¡¢½áºÏʹÓÃ
Ò»¡¢×Ô¶¨Òå×é¼þ£¨Ê¹ÓõÄÊÇFlex×é¼þ£¬ActionScript×é¼þÏà¶ÔÂé·³µã£¬¿ÉÊÓ»¯²îµã£©
¸Ã×é¼þÓÉÒ»¸öTextAreaºÍÁ½¸öButton×é³É£¬Èçͼ£º
´úÂ룺
MyComponent.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="180" height="94" creationComplete="initComponent()">
<mx:Metadata>
/**
* 1. ±àÒëÆÚ¼äÖ´ÐÐ
* 2. ×Ô¶¨Òå×é¼þÒ»°ã¿ÉÒÔͨ¹ýdispatchEventίÅÉparentÀ´´¦Àíij¸öʼþ£¬Õâ¾ÍÐèÒªÔÚparentÖÐÉèÖÃÒ»¸öaddEventListerÀ´¼àÌýʼþ¡£
* ¾ÍÏñButtonµÄEvent.CLICKʼþ£¬³ýÁË¿ÉÒÔͨ¹ýaddEventLister(Event.CLICK, clickHandle)À´¼àÌý´¦ÀíÍ⣬ÔÚFlex×é¼þÖл¹¿ÉÒÔ
* Ö±½Ó mx:Button click="clickHandle(event)" / ¡£Ôõô¶¨Òå×Ô¶¨Òå×é¼þÒ²¿ÉÒÔ´ïµ½Èç´ËЧ¹ûÄØ£¿
* 2.1) ÄÚ²¿ÉùÃ÷£º[Event(name="commit",type ="laxino.MyEvent")]£¬typeÊÇָʼþµÄÀàÐÍ£¨Èç1µÄÀàÐÍÊÇint,'aaa'µÄÀàÐÍÊÇString£©,nameÊÇÖ¸
* EventÖеĹ¹Ô캯ÊýÖÐtype¡£
* 2.2) ÍⲿʹÓãºcommit="commitHandle(myEvent)"ÊÇָΪ¸Ã×é¼þ×¢²áÁËÒ»¸ö¼àÌýÆ÷£¬¼àÌýÃû×Ö½ÐcommitµÄʼþ£¬²¢Í¨¹ýcommitHandle´¦Àí¡£Ê¼þµÄ´¥·¢ºÍ
* ίÅɱØÐëÔÚ×é¼þÄÚʵÏÖ¡£
*
*/
/**
*
* Using the Event metadata tag
* You use the [Event] metadata tag to define events dispatched by a component so that the Flex compiler can recognize
* them as MXML tag attributes in an MXML file. You add the [Event] metadata tag in one of the following locations:
* ActionScript components Above the class definition, but within the package definition, so that the events are bound
* to the class and not a particular member of the class.
* MXML components In the mx:Metadata tag of an MXML file.
*
*/
[Event(name="commit",type ="laxino.MyEvent")]
[Event(name="preview",type ="laxino.MyEvent")]
</mx:Metadata>
<mx:Script>
<!--[CDATA[
private function initComponent():void
{
}
private function preview(event:Event):void
{
this.dispatchEvent(new MyEvent(MyEven
Ïà¹ØÎĵµ£º
var login:infoChange=infoChange(PopUpManager.createPopUp( this, infoChange , true));
login.x=250;
login.y=150;
login.userid.text=dg.selectedItem.aa;
login.username.text=dg.selectedItem.bb;
......
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<mx:Application xmlns:mx=
"http://www.adobe.com/2006/mxml"
xmlns:assql=
"com.maclema.mysql.mxml.*"
& ......
Ò»¡¢¹úÍâÕ¾µã
1.×ÊÔ´ Àà
Adobe Flex 2 Component Explorer £º ¹Ù·½µÄ£¬Õ¹Ê¾Á˸÷ÖÖ×é¼þ µÄÓ÷¨ £¬ÈëÃÅ ±Ø¿´¡£
CFlex £ººÜºÃµÄÒ»¸öFlex×ÊÔ´Õ¾µã£¬°üÀ¨½Ì³Ì £¬ÐÂÎÅ£¬×ÊÔ´Õ¾µã…… Ö»ÊÇÒ³ÃæÓеãÔÓÂÒ£¬´ó¼ÒÒ»°ã¿´ÓÒ±ßÄÇÒ»À¸¾ÍÐÐÁË¡£
FlexBox £ºÒ»¸öÊÕ¼¯ ÁËÍøÉϺܶ࿪Դ ×é¼þµÄÕ¾µã£¬Êǽø½×ѧϰ µÄºÃ°ïÊÖ¡£
Flex ......
1.ÔÚ<Object>ºÍ<embed>ÖÐÉèÖÃflashVars²ÎÊý£¬ÀýÈ磺
<object id=’mySwf’ classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ codebase=’http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab’ height=’100%’ width=’100%&rs ......
http://yecon.blog.hexun.com/36798900_d.html
ʹÓà Adobe Flex ²úÆ·ÏßµÄʱºò£¬²ÉÓÃͼ±íºÍͼÐÎÀ´Õ¹Ê¾Êý¾Ý»áʹÓû§ÓëÊý¾ÝµÄ½»»¥¸ü¼ÓÈÝÒס£Ïà¶Ô¼òµ¥µÄÊý×Ö±í¸ñÀ´Ëµ£¬¿ÉÒÔʹÓñíʾÊý¾ÝµÄ²»Í¬ÑÕÉ«¡¢±êÌâ¡¢ÏßÌõÀ´Õ¹Ê¾ÌõÐÎͼ¡¢±ýͼ¡¢ÏßͼµÈµÈ¡£
ͼ±í¿Ø¼þÊÇ Adobe Flash Builder רҵ°æµÄÌØÐÔ¡£Ò²¿ÉÒÔÔÚ Falsh Builder ±ê×¼°æÖ ......