Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½ÌÄã7²½ÊµÏÖflex×Ô¶¨ÒåEvent¼°²ÎÊý´«µÝ

¡¡¡¡FlexÓ¦Óÿª·¢¹ý³ÌÖÐÈçÐèÒªÁé»îµÄÔÚ²»Í¬×é¼þ£¨ÈçAÓëB£¬¸¸Óë×Ó£©Ö®¼äÏìӦʼþ£¬´«µÝ²ÎÊýµÈ¹¦ÄÜʱ¾Í»áʹÓÃ×Ô¶¨Òåʼþ£¨Event£©»úÖÆ,ÏÂÃæͨ¹ýÒ»¸öÊÂÀý·ÖÆß²½,ͨ¹ý×Ô¶¨ÒåEventºÍEventDispatcherÁ½ÖÖ»úÖÆʵÏÖʼþ½»»¥ºÍ²ÎÊý´«µÝ;
        ÊÂÀýÃèÊö:¡¡ÓÐÒ»¸ö¸¸ÇדparentApp.mxml”ÓÐÁ½¸ö¶ù×Ó“comBrotherA.mxml”ºÍ"comBrotherB.mxml",ÐÂÄê½µÖÁ£¬Á½¸ö¶ù×ÓΪ±íТÐÄ·Ö±ð¸øËûÃÇÀÏ°Ö´æÈë(ʼþ)Ò»±Ê¹ý½Ú·Ñ(ʼþ²ÎÊý),²¢Í¨ÖªÀÏ°ÖÎÒ´æÇ®½øÈ¥ÁË£¬ÀÏ°ÖÔÚÊÕµ½Á½¸ö¶ù×ÓµÄÇ®ºó»ã×ܺóͬʱ¸æËß(ʼþ)Á½¸ö¶ù×ÓÇ®ÎÒÒÑÊÕµ½×ÜÊý(ʼþ²ÎÊý)ÊǶàÉÙ...
    1¡¢µÚÒ»²½£ºÒýÈë×Ô¶¨Òå×¢²áʼþ²ÎÊý´«µÝÀ©Õ¹Àà(À´×ÔÍøÂç)
    package myeventhelper
{
//×Ô¶¨Òå×¢²áʼþ²ÎÊý´«µÝÀ©Õ¹Àà
public class EventArgExtend
{
public function EventArgExtend()
{
}
public static function create(f:Function,...arg):Function //¶¯Ì¬²ÎÊý´´½¨
{
var F:Boolean = false;
var _f:Function = function(e:*,..._arg)
{
_arg = arg;
if(!F)
{
F = true;
_arg.unshift(e);
}
f.apply(null,_arg);
};
return _f;
}
public static function toString():String
{
return "Class JEventDelegate";
}
}
}

    2¡¢µÚ¶þ²½£º×Ô¶¨Òåʼþ´¥·¢Àࣺ
package myeventhelper
{
import flash.events.EventDispatcher;

import mx.core.UIComponent;
//×Ô¶¨Òåʼþ´¥·¢Àà
public class MyEventDispatcher extends EventDispatcher
{
private static var _instance:MyEventDispatcher;
public static const EXEC_PARENT_METHOD:String="ExecParentMethod"; //Ö´ÐÐParent·½·¨
public static function getI


Ïà¹ØÎĵµ£º

flexʱÐòͼʾÀý

<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>

import mx.collections.ArrayCollection;
......

flex ʵÏÖºáÏòÊ÷״ͼ

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="initApp()"
backgroundColor="#FFFFFF">
<mx:Canvas id="paper"
......

FLEX no.4

-----------------ex4_01_solution------------------Creating an event and dispatching the event object
<s:Application ...
creationComplete="employeeService.send()">
»á´¥·¢£º
    <!-- Declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   
& ......

flex »ñµÃ¿Í»§¶ËÐÅÏ¢


flash.system. Capabilities.os;//¿Í»§¶Ëϵͳ°æ±¾
flash.system.Capabilities.language;//¿Í»§¶ËÓïÑÔ
flash.system.Capabilities.version;//²¥·ÅÆ÷°æ±¾
flash.system.Capabilities.playerType;//²¥·ÅÆ÷ÀàÐÍ
flash.system.Capabilities.screenResolutionX&Y;//·Ö±æÂÊ ......

FlexͨÐÅƪ——FlexºÍÍⲿ½øÐÐÒ첽ͨÐÅ

ExternalInterface.callµÄÎÊÌâ
ÇëÁôÒâÒÔÏÂÇé¾°£¬ÒªÀûÓÃÍⲿӦÓóÌÐòµ¯³öÎļþÑ¡Ôñ´°Ì壬²¢·µ»ØËùÑ¡µÄÎļþ·¾¶¡£
ʹÓÃExternalInterface.callÀ´ÊµÏÖ£¬µ±Óû§60Ãë(FlexÒѾ­ÉèÖÃ×µÄµÈ´ýʱ¼ä)ÄÚδÄܹ»Íê³ÉÎļþÑ¡Ôñ»áµ¯³ö"1502"µÄ´íÎó£¬ÑÏÖØÓ°ÏìÓû§ÌåÏÖ¡£
ËùÒÔ£¬Ò»Ð©±È½ÏºÄʱµÄ²Ù×÷(³¬¹ý60s)£¬»òÎÞ·¨È·¶¨ºÎʱµ÷ÓÃÍê³ÉµÄ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ