Flex¹Ø±Õʼþ
µ±¹Ø±Õ×°ÔØFlexµÄä¯ÀÀÆ÷´°¿Ú£¨µã»÷ÓÒÉÏ½ÇµÄ x ¹Ø±Õ£©»á´¥·¢Ê²Ã´Ê¼þ£¿
»òÕß˵Ôõô¼àÌýÕâ¸ö¶¯×÷£¿
ʹÓÃJavaScriptÀ´¼à²¶»ñÕâ¸öʼþ°É£¬FlexòËƼàÌý²»µ½
ÓÃjsµÄ unloadʼþÂð£¿
ÆäʵÎÒÏÖÔÚÊÇÔÚ×öÒ»¸öÓÃjava×öºǫ́µÄsocket
ÎÒÏ벶»ñ´ËʼþÊÇΪÁ˵±±¾Ò³Ã汻жÔØʱ´¥·¢Ò»¸öʼþ
ʼþÖÐÒªÈÃFlexµ÷ÓÃjavaµÄ¹Ø±ÕsocketµÄ·½·¨¡£
¿ÉÊÇjs²¶»ñµ½Ê¼þºóÈçºÎµ÷ÓÃFlexÀïµÄ·½·¨£¿
flex
-------------
ExternalInterface.call("window.onbeforeunload()");
js
------------
function window.onbeforeunload(){
window.close();
}
3Â¥µÄ´óÏÀ¡£·´ÁË°É£¿ÎÒÊÇ˵jsµ÷Flex°¡¡£¡£¡£
¹Ø±Õä¯ÀÀÆ÷´°¿ÚµÄÐÐΪ£¬Ó¦¸ÃÖ»ÄÜͨ¹ýJSÀ´ÊµÏÖÁË£¬flexÓ¦¸ÃÄò»µ½£¬swfÒ²Ëæ×Åä¯ÀÀÆ÷¹Ø±Õ±»Ð¶ÔØÁË¡£
¹ÛÍû~
ÔÚFlexÖÐ×¢²á»Øµ÷ʼþ,Ò»°ãдÔÚFlex¼ÓÔØ·½·¨ÖÐ:
Java code:
ExternalInterface.addCallback("sendToActionScript", receivedfromJavaScript);
FlexÖеĻص÷·½·¨(Ï£Íû±»JSµ÷Óõķ½·¨):
Java code:
private function receivedfromJavaScript(´Ë´¦¿ÉÒÔ½Ó²Î):void
{
Ïà¹ØÎÊ´ð£º
FlexÊÇ·ñÓв¢·¢¿ØÖƲßÂÔ£¿
Ò³ÃæÖÐÓжà¸öTImer£¨ ÓÿɿÉÒÔÉèÖÃTimerÊýÁ¿£©
·Ö±ð¶¨Ê±´Ó·þÎñÆ÷È¡µÃÊý¾Ý£¬¸üÐÂÒ»¸öArray±äÁ¿¡¢
Õ⼸¸öTimerÓпÉÄܵ¼Ö²¢·¢µÄ¶ÔArray±äÁ¿·ÃÎÊ¡£
ÇëÎÊFlexÊÇ·ñÓв¢·¢¿Ø ......
ÇëÎʸ÷λ´óϺ£º
<mx:Button label="Image Button"
toggle="true"
color="0xFFFFAA"
textRollOverColor="0x ......
ÈçÌâ
ÎÒÏë´ÓjsÖлñÈ¡Ò»¸öÊýÖµ£¬È»ºó´«µÝ¸øflex£¬Êý¾ÝÊÇÓÃÀ´×öͼ±íÓõÄ
ÎÊÌâ¾ÍÊÇ
private var medalsAC:ArrayCollection = new ArrayCollection( [
{ Countr ......
ÎÒʹÓÃFlexµÄDataGrid×öÁËÒ»¸öÊý¾ÝչʾҳÃ棬Êý¾Ý´ÓÊý¾Ý¿âÖжÁ³ö£¬´óÔ¼ÓÐ1000Ìõ×óÓÒ£¬½á¹ûÔÚÍ϶¯¹ö¶¯ÌõµÄʱºò·¢ÏÖCPUÕ¼ÓÃÒ»ÏÂ×Ó»áÉÏÉýµ½100%£¬½çÃæ¾Í¿¨ËÀÁË£¬¹ý¼¸Ãë²ÅÄָܻ´¡£ÇëÎÊÕâ¸öÇé¿öÔõô½â¾ö°¡£¿
·Öҳȡ
Ê ......