FlexʵÏÖQQÍøÒ³ÌáÈ¡ÌìÆøÐÅÏ¢
1¡¢Ô¤±¸ÖªÊ¶
FlexÊÇAdobeÌṩµÄ»ùÓÚFlash»·¾³µÄRIAÕ¹ÏÖ¼¼Êõ£¬Ö÷Òª²ÉÓÃMXML+Action ScriptÀ´±àд³ÌÐò¡¢½çÃ棬Ȼºóͨ¹ý±àÒëÆ÷±àÒë³Éflash¸ñʽµÄSWFÎļþ·¢²¼µ½ÍøÕ¾ÉÏ¡£
ʵÏָù¦ÄÜÐèÒª°²×°Flex SDK£¬¿ÉÒÔ´ÓAdobeÍøÕ¾ÉÏÃæÏÂÔØ£¬»òÕß°²×°Flex Builder plugin+EclipseÀ´¿ª·¢¡£
ͬʱÐèÒª¾ß±¸¼òµ¥µÄÕýÔò±í´ïʽ֪ʶ¡£
2¡¢½çÃæ²¼¾Ö¡¢´úÂëʵÏÖ
Îļþ£ºQQWeather.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="213" height="234" creationComplete="initApp()" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#F6FBFC, #3FEEDC]">
<mx:Style>
.myfont{font-size:12pt;font-family:'ËÎÌå';}
</mx:Style>
<mx:Script source="QQWeather.as"></mx:Script>
<mx:Label x="10" y="53" text="Ñ¡Ôñ³ÇÊÐ:" styleName="myfont"/>
<mx:ComboBox id="cmbCity" x="66" y="49" width="133" rowCount="6" change="changeHandler(event);" styleName="myfont"></mx:ComboBox>
<mx:Image x="10" y="10" source="@Embed('../title.gif')" width="189" />
<mx:Image x="10" y="106" source="@Embed('../tem1.png')" width="57" height="13"/>
<mx:Image x="10" y="132" source="@Embed('../tem2.png')" width="57" height="13"/>
<mx:Image x="10" y="178" source="@Embed('../tem3.png')" width="57" height="13"/>
<mx:Image x="10" y="154" source="@Embed('../tem5.png')" width="57" height="13"/>
<mx:Label x="75" y="103.5" text="" width="110" styleName="myfont" id="t1"/>
<mx:Label x="75" y="129.5" text="" width="110" styleName="myfont" id="t2"/>
<mx:Label x="75" y="151.5" text="" width="110" styleName="myfont" id="t3"/>
<mx:Label x="75" y="175.5" text="" width="110" styleName="myfont" id="t4"/>
<mx:Label x="34" y="202" text="Label" width="169" styleName="myfont" textAlign="right" id="lbToday"/>
<mx:Label x="10" y="80" width="193" id="t0"
Ïà¹ØÎĵµ£º
ÔÚ¹Ù·½ÍøÕ¾adobeÉÏ¿ÉÒÔÏÂÔص½±àдFlex³ÌÐòµÄ»ù±¾¹¤¾ß,Ê×ÏÈÎÒÃÇ»¹ÊÇÔËÓÃtextµÄ·½Ê½À´¿ª·¢ÎÒÃǵĵÚÒ»¸ö³ÌÐò£¬²¢ÇÒ½¨ÒéÔËÓÃAnt¹¤¾ßÀ´²¿ÊðÔËÐÐÎÒÃǵijÌÐò¡£¾ßÌåÇé¿öÈçÏ£º
ÉèÖû·¾³±äÁ¿path=D:\FreeFlex\sdks\3.2.0\bin
ÎļþÃû³Æ£ºmxmlc HelloWorld.mxml
mxmlc -keep-generated-actionscript ......
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style />
<mx:Script>
& ......
¸ù¾Ý±ðÈËдÁËÀ࣬×Ô¼ºÓÖÔö¼ÓÁËÒ»²¿·Ö£¬Ìù³öÀ´·ÖÏí
/*»ñµÃÁ½¸öÈÕÆÚÖ®²î */
public static function getDateDiff(startDate:Date, endDate:Date):int
{
var diff:Number = (Number(endDate) - Number(startDate))/(3600000*24);
return diff;
}
/* »ñµÃÏÖÔÚÈÕÆÚ */
public static function getDate() ......
No.1 ij×Ö·ûÆ÷·Åµ½Õ³Ìù°æ:
System.setClipboard(strContent);
No.2 ¸´ÖÆÊý×é:
//dummy solution( well, it works )
var bar:ArrayCollection = new ArrayCollection();
for each ( var i:Object in ac ){
bar.addItem( i );
}
// fantastic ! //
var bar:ListCollectionView = new ListCollectionVi ......
Æäʵ¶ÔÓÚÕâ¸öÌâÄ¿ÊDz»Ç¡µ±µÄ£¬ÒòΪflexÖÐÊÇûÓÐÒ³ÃæÕâ¸ö¸ÅÄîµÄ£¬Ò³ÃæÔÚflexÀïÃæÆäʵ¾ÍÊÇÒ»¸ö¸öµÄCanvas£¬vbox£¬
hboxµÈµÈÖ®ÀàµÄ¶«Î÷£¬¿´µ½µÄ²»Í¬Ò³ÃæµÄÇл»£¬¾ÍÊÇÕâЩԪËØÒ»²ã²ãµÄ¶Ñ»ý£¬»òÕßÌæ»»£¬µ«ÊÇΪÁ˺ÃÀí½â£¬»¹ÊdzÆ֮Ϊ
"Ò³ÃæÌøת"¡£ÆäʵÎÒÃÇ¿ÉÒԶԱȴ«Í³µÄC/S¿ª·¢Ä£Ê½£¬Ã»Ò³ÃæÌøת£¬Ö»Óд°ÌåºÍÔª¼þµÄÏÔʾºÍÒ ......