12ÌõÓÐÓõÄFlex´úÂë
1.¸´ÖÆÄÚÈݵ½ÏµÍ³¼ôÌù°å
System.setClipboard(strContent);
2.¸´ÖÆÒ»¸öArrayCollection
//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 ListCollectionView( ListCollectionView( ac ).list );
3.´ò¿ªÒ»¸öÐÂä¯ÀÀÆ÷´°¿Ú
navigateToURL(new URLRequest('http://ntt.cc'), '_blank');
4.Ë¢ÐÂä¯ÀÀÆ÷
navigateToURL(new URLRequest("javascript:location.reload();"),"_self");
5.¹Ø±Õä¯ÀÀÆ÷
navigateToURL(new URLRequest("javascript:window.close()"),"_self");
6.ÉèÖÃAlert ´°¿ÚµÄ±³¾°ÎªÍ¸Ã÷
Alert
{
modalTransparency:0.0;
modalTransparencyBlur:0;
}
7.È¡Ëæ»úÑÕÉ«
lbl.setStyle('color', 0xffffff*Math.random());
8.Çå³ý×Ó´®×ó²à¿Õ¸ñ
public function LTrim(s : String):String
{
var i : Number = 0;
while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) == 10 || s.charCodeAt(i) == 9)
{
i++;
}
return s.substring(i,s.length);
}
9.Çå³ý×Ö´®ÓÒ²à¿Õ¸ñ
public function RTrim(s : String):String
{
var i : Number = s.length - 1;
while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) == 10 ||s.charCodeAt(i) == 9)
{
i--;
}
return s.substring(0,i+1);
 
Ïà¹ØÎĵµ£º
flexµ¯³ö¶Ô»°¿òʾÀý³ÌÐò·ÖΪÁ½²¿·Ö£ºMain.mxmlºÍSimpleTitleWindowExample.mxml£¬ÆäÖÐMail.mxmlΪÖ÷³ÌÐòÎļþ£¬SimpleTitleWindowExample.mxmlΪ¶Ô»°¿òÎļþ£¬¿ÉÒÔͨ¹ýÐÞ¸ÄSimpleTitleWindowExample.mxmlÎļþÀ´Ð޸ĶԻ°¿òÉϵÄ×é¼þ¡£
Main.mxml
<?xml version="1.0" encoding="ut ......
1. ×î¼òµ¥µÄ¾¯¸æ´°¿Ú
ÄãÐèÒªÏȵ¼ÈëAlertÀࣺ import mx.controls.Alert;
È»ºóÔÚÏëÒªµ¯³ö¾¯¸æµÄʱºòʹÓãº
Alert.show(“ÄãÈ·¶¨ÒªÍ˳öϵͳÂð?”,“È·ÈÏ”,Alert.YES|Alert.NO,null,logout)
²ÎÊý˵Ã÷£ºµÚÒ»¸ö²ÎÊýÊÇÒªÏÔʾµÄÎı¾£¬µÚ¶þ¸ö²ÎÊýÊÇ´°¿ÚµÄ±êÌ⣬ÕâÁ½¸ö²ÎÊýÊÇ×î¾³£Óõġ£µÚÈý¸ö²ÎÊýÊÇ°´Å¥£ ......
1.Èç¹ûʹÓÃMVC¿ò¼Ü£¬ÏàÐÅÕâ²¢²»ÊÇÒ»¸öÎÊÌâ¡£¶øÈç¹ûûÓÐʹÓõĻ°£¬¿ÉÒÔÓÃÀàËƵķ½·¨ÉèÖÃÒ»¸öµ¥Àý£¬×Ó´°¿ÚºÍ¸¸´°¿Úͨ¹ýÕâ¸öµ¥ÀýÀ´½»»¥ÏûÏ¢£¬Èç¹ûÐèÒª½âñÇë·¢ËÍ×Ô¶¨Òåʼþ¡£×ÜÖ®£¬Ö»Òª°´ÕÕMVC˼·À´×ö¾Í¿ÉÒÔÁË¡£
2.ÀàËÆJS£¬ÔÚ×Ó´°¿ÚµÄ¹¹Ô캯ÊýÀïÔö¼ÓÒ»¸ö²ÎÊý£¬½«¸¸´°¿Ú´«²Î½øÈ¥¡£MXMLûÓй¹Ô캯Êý£¬ÓÃÒ»¸öÊôÐÔÀ´±£´æ¸¸´°¿Ú ......
2ÖÖ·½·¨£¬
Ò»£¬ÀûÓÃjs¶ÁÈ¡ð¤Ìù°æ£º
var content = clipboardData.getData("Text");
document.getElementById("${application}").getClipboardData(content);
¶þ£¬Ö±½Ó¸´ÖƵ½datagrid
ÔÚDataGridÖУ¬µ±°´ÏÂCtrl¼üʱ£¬ÎÒÃÇ´´½¨Ò»¸öÒþ²ØµÄÎı¾£¨TextField£©×é¼þ£¬²¢½«½¹µã¶¨Î»¸øËü£¬ÕâÑù£¬ÎÒÃǾͿÉÒÔ½ÓÊÜÈκÎͨ¹ýCtrl+VÕ ......
ÊÔÓÃÁËÒ»ÏÂFlex£¬´´½¨HelloWorldÓ¦ÓõÄ˳ÐòÈçÏ£º
1 ´´½¨Îļþ: HelloWorld-app.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
<id>com.kdevn.flex.HelloWorld</id>
<version&g ......