FlexǶÌ×ÈÝÆ÷µÄÉú³É´ÎÐò
֮ǰһֱûÔÚÒ⸸ÈÝÆ÷ºÍ×ÓÈÝÆ÷¸÷×ÔµÄÉú³É´ÎÐò£¬ÖªµÀÔÚÏîÄ¿ÖÐÓöµ½Ò»ÖÖcase:³õʼ»¯½çÃæʱ¸¸ÈÝÆ÷³õʼ»¯µÄÄÚÈÝÓÉ×ÓÈÝÆ÷Ïȳõʼ»¯ÔÙ´¥·¢£¬µ«ÊǸ¸ÈÝÆ÷±ØÐëÔÚ³õʼ»¯Ê±¾ÍÒѾ¼ÓÉÏÁ˶Ô×ÓÈÝÆ÷µÄ¼à¿Ø¡£Õâ¾ÍÔì³ÉÒ»¶Ôì¶Ü£¬¼ÈÏëÏÈÉú³É×ÓÈÝÆ÷ÓÖÏëÏÈÉú³É¸¸ÈÝÆ÷¡£
ÏÈ×Ô¼ºÐ´¶Î´úÂë²âÊÔÒ»ÏÂÉú³É˳Ðò£¬¸¸ÈÝÆ÷
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:guoguo="*" layout="absolute" initialize="init()" creationComplete="created()">
<mx:Script>
<!--[CDATA[
public function init():void
{
trace("parents init");
}
public function created():void
{
trace("parents created");
}
]]-->
</mx:Script>
<guoguo:children />
</mx:Application>
×ÓÈÝÆ÷
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" initialize="init()" creationComplete="created()">
<mx:Script>
<!--[CDATA[
public function init():void
{
trace("child init");
}
public function created():void
{
trace("child created");
}
]]-->
</mx:Script>
</mx:Canvas>
debugÏÂtraceµÄ½á¹ûΪ
child init
parents init
child created
parents created
ËùÒÔËûµÄ´ÎÐòÊÇÏȳõʼ»¯×ÓÈÝÆ÷ÔÙ³õʼ»¯¸¸ÈÝÆ÷ÔÙÍê³É×ÓÈÝÆ÷ÔÙÍê³É¸¸ÈÝÆ÷£¬ËµÆðÀ´ºÜÞÖ¿Ú¡£Ã²ËÆÄܽâ¾öÎÒÒ»¿ªÊ¼µÄÎÊÌâÁË£¬ÄǾÍÊÇ·Ö¿ªÐ´initºÍcreated£¬parent initʱ¼Ó¼à¿Ø£¬child createdʱ¼ÓÔØÊý¾Ý£¬parents createdÔÙµ÷Óá£ÀíÂÛÉÏÊÇ¿ÉÒԵģ¬µ«ÊÇÎÒÔÚÏîÄ¿ÖеÄÇé¿öÓеãÌØÊ⣬ÒòΪҪµ÷ÓÃhttpService,ÊÇÒì²½Ö´ÐС£
ÔÙ×öÒ»¸öʵÑ飬¸¸ÈÝÆ÷Öд«²ÎÊý
<guoguo:children username="doudou" />
×ÓÈÝÆ÷ÖдúÂë¸ÄΪ
public var username:String ="xiaomaomao" ;
public function init():void
{
trace("child init" + username);
}
public function created():void
{
trace(&
Ïà¹ØÎĵµ£º
flex ¿Ø¼þÊôÐÔ
2009-11-12 16:06
ʹÓÃ<mx:Style>±êÇ©ÔÚMXMLÎļþÖд´½¨±¾µØµÄÑùʽ¶¨Òå¡£Õâ¸ö±êÇ©°üº¬ÁË·ûºÏCSS2.0Óï·¨µÄÑùʽ±í¶¨
Òå¡£ÕâЩ¶¨Òå»áÓ¦Óõ½µ±Ç°ÎĵµÒÔ¼°µ±Ç°ÎĵµµÄ×ÓÎĵµ¡£
<mx:style>
.solidBorder{//ÀàÑ¡ÔñÑùʽ
borderStyle:solid;
}
button{//×é¼þ¶¨ÒåÑùʽ
borderStyle:solid;
}
.. ......
Óõ½µÄMX±êÇ©£ºconstraintColumns¡¢ConstraintColumn¡¢constraintRows¡¢ConstraintRow
¸ø´ó¼Ò˵˵ǰÌáÇé¿ö£ºÔÚ×öMXML²¼¾Öʱ£¬ÒªÇ¶Ì׺ܶà²ã¼¶£¬ÕâÀïÃæÓкܶàÎÊÌ⣺
1¡¢Ç¶Ì×Ì«¶à²ã¼¶»áÓ°ÏìЧÂÊ£¡
2¡¢Ç¶Ì×Ì«¶à²ã¼¶£¬´úÂëµÄ¿É¶ÁÐÔ¡¢¿Éά»¤ÐԲ
3¡¢Ç¶Ì×Ì«¶à²ã¼¶ÊÇÒòΪCanvas¡¢Vbox¡¢Hbox¹¦Äܵ¥Ò»£¬²»ÄÜÂú×ãÐèÒª£¬¶ø²»ÊDZØÐ ......
Flex4Öж¯Ì¬¼ÓÔØCSSÎļþµÄ·½Ê½ÒѾºÍFlex3ÓÐÁËÒ»¶¨µÄÇø±ð
Ö÷Òª²½ÖèÈçÏ£º
1.±àд²»Í¬µÄCSSÎļþ
¼ûºóÎÄ
2.½«CSSÎļþ±àÒë³ÉSWFÎļþ
ÔÚFlashBuilderÖÐÓÒ¼üCSSÎļþ£¬Ñ¡ÔñCompile CSS to SWF£¬
Õâʱbin-debugĿ¼ÏµĶÔӦλÖþͻáÉú³ÉÒ»¸öÓëCSSͬÃûµÄSWFÎļþ¡£
Ñ¡Öкó¸ÃÑ¡ÏîÇ°»áÓй´£¬Ö®ºóÖ»ÒªÐÞ¸ÄÁËCSSÎļþ£¬¾Í»á×Ô¶¯±àÒ ......
×î½üÔÚÑо¿flex¼¼Êõ£¬flexºÍflashµÄ½»»¥£¬flexºÍJavaµÄͨÐÅ¡£Ï±ßÊÇÒ»¸öflex¿ØÖÆswfÎļþÖÐÔª¼þµÄ·¶Àý£¬¸Õ½Ó´¥flex£¬ÈçÓв»¶ÔµÄµØ·½£¬´ó¼Ò¶àÌáÒâ¼û¡£
mxmlÎļþ£º
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
&n ......
flashbuilderÖпÉÒÔ½¨Á¢flex¹¤³ÌÓëactionscript¹¤³Ì.
flex¹¤³ÌÄÚ¿ÉÒÔʹÓÃmxmlÊÇÍê³ÉÉè¼Æ¹¤×÷.
actionscript¹¤³Ì½¨Á¢Ê±Ä¬ÈÏÖ»ÓÐ:
playerglobal.swc
flex.swc
utilities.sec
playerglobal.swc
Õ⼸¸öÀà¿â.ûÓÐframework.swc,¾ÍÎÞ·¨Ê¹ÓÃButtonµÈ¿Ø¼þÁË.
½â¾ö·½°¸ÊÇ actionscript¹¤³ÌÖмÓÈëframework.swc.
·¾¶ÊÇ x:/A ......