Flex Timer ¶¨Ê±Æ÷
flash.util.TimerÀà
flash.util.TimerÀàÔÊÐíͨ¹ýÌí¼Óʱ¼äʼþ»òÑÓʱÀ´µ÷Ó÷½·¨¡£Í¨¹ýTimer¹¹ÔìÆ÷´´½¨ÊµÀý¶ÔÏ󣬴«µÝÒ»¸öºÁÃëÊý×Ö×÷Ϊ¹¹Ôì²ÎÊý×÷Ϊ¼ä¸ôʱ
¼ä£¬ÏÂÃæµÄÀý×ÓʵÀý»¯Ò»¸öTimer¶ÔÏóÿ¸ö1ÃëÖÓ·¢³öʼþÐźţº
var timer.Timer = new Timer(1000);
Ò»µ©´´½¨ÁËTimerʵÀý£¬ÏÂÒ»²½±ØÐëÌí¼ÓÒ»¸öʼþ¼àÌýÆ÷À´´¦Àí·¢³öµÄʼþ£¬Timer¶ÔÏó·¢³öÒ»¸öfalsh.event.TimerEventʼþ£¬
ËüÊǸù¾ÝÉèÖõļä¸ôʱ¼ä»òÑÓʱʱ¼ä¶¨Ê±·¢³ö¡£ÏÂÃæµÄ´úÂ붨ÒåÁËÒ»¸öʼþ¼àÌý£¬µ÷ÓÃonTimer()·½·¨×÷Ϊ´¦Àíº¯Êý£º
timer.addEventListener(TimerEvent.TIMER, onTimer);
function onTimer(event:TimerEvent):void{
trace("on timer");
}
Timer¶ÔÏó²»»á×Ô¶¯¿ªÊ¼£¬±ØÐëµ÷ÓÃstart()·½·¨Æô¶¯£º
timer.start();
ĬÈÏÇé¿öÏÂÖ»Óе÷ÓÃstop()·½·¨²Å»áÍ£ÏÂÀ´£¬²»¹ýÁíÒ»ÖÖ·½·¨ÊÇ´«µÝ¸ø¹¹ÔìÆ÷µÚ¶þ¸ö²ÎÊý×÷ΪÔËÐдÎÊý£¬Ä¬ÈÏֵΪ0¼´ÎÞÏ޴Σ¬ÏÂÃæµÄÀý×ÓÉ趨¶¨Ê±Æ÷ÔËÐÐ5
´Î£º
var timer:Timer = new Timer(1000, 5);
ÏÂÃæµÄ´úÂëÉ趨¶¨Ê±Æ÷ÑÓʱ5ÃëÖ´ÐÐdeferredMethod()·½·¨£º
var timer:Timer = new Timer(5000, 1);
timer.addEventListener(TimerEvent.TIMER, deferredMethod);
timer.start();
Ïà¹ØÎĵµ£º
ÉÏ´ÎÌýÅóÓÑÌáÆðÏÖÔÚÔÙÓÃFlex×öÏîÄ¿£¬ÏÐϾ֮ÓàÔÚ×Ô¼ºµÄµçÄÔÉÏÅäÖÃÁËFlex + myeclipseµÄ¿ª·¢»·¾³¡£ËäÈ»¿ª·¢»·¾³´î½¨»¨Á˲»ÉÙµÄʱ¼ä£¬Ò²Óöµ½Á˲»ÉÙÎÊÌâ¡£ÔÙ½â¾öÕâЩÎÊÌâµÄʱºò£¬Ò²ÕÒÁ˲»ÉÙµÄ×ÊÁÏ£¬Ñ§µ½Á˲»ÉÙ¶«Î÷¡£ºÇºÇ
¼ÌÐøÑо¿Ñ§Ï°................... ......
ÏÖÔÚ¸»webÓ¦ÓÃÒѾÊǸö´óÇ÷ÊÆ£¬Ô½À´Ô½¶àµÄ´«Í³¿Í»§¶ËÓ¦Óö¼Ïà¼Ì±»webÓ¦ÓÃËùÌæ´ú¡£µ«ÊǼøÓÚwebÓ¦ÓõÄÈõ½»»¥ÐÔ£¬ºÜ¶àÒµÎñ¸ºÔð¡¢ÈË»ú½»»¥Ç¿µÄÓ¦Óô¿js»¹ÊDz»ÄܺܺÃʤÈΣ¬Õâ¿ÖÊÇÄ¿Ç°»¹Óкܶà»îÔ¾csÓ¦ÓôæÔÚµÄÒ»¸öÖ÷ÒªÔÒò¡£Ç°²»¾Ã£¬¹«Ë¾Ò²ÔÚ×ö¼èÄѵÄÑ¡ÔñwebÓ¦ÓÃǰ̨¿ª·¢¿ò¼ÜÑ¡ÐÍÎÊÌ⣬×îº ......
ÉÏÃæÊÇÒ»¸öflex×öµÄÑ¡Ôñ£¬Ö÷ҪѧϰÊý¾Ý Model¸úDateGridµÄÓ÷¨ ¹þ£¬Ô´ÂëÈçÏ£º
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="12">
<mx:Model id="books">
<datas>
<book>
  ......
·µ»ØÊý¾ÝµÄ¸ñʽresultFormatÓм¸ÖÖÀàÐÍ£¬object¡¢array¡¢xml¡¢flashvars¡¢textºÍe4x£¬Ä¬ÈϵÄÉèÖÃΪobject¡£
RESULT_FORMAT_ARRAY : String = "array"
[] ½á¹û¸ñʽ“array”Óë“object”ÏàËÆ£¬µ«ÊÇÆä·µ»ØµÄֵʼÖÕΪÊý×飻ÕâÑù£¬Èç¹û´Ó½á¹û¸ñʽ“object”·µ»ØµÄ½á¹ûÉв»ÊÇÊý×飬Ôò½«°Ñ¸ÃÏî ......