<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Module之間的通信交互解決辦法

    看看以下的代碼,有點(diǎn)意思
    1.子Swf的Code,SampleChildren.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        
    <mx:Script>
            
    <![CDATA[
                import mx.managers.SystemManager;
                public 
    function output(s:String):void{
                    trace(s);
                }

                
                public 
    function CallFriend():void{
                    SampleChildren(_SystemManager.application).output(
    "call");
                }

                
                private 
    var _SystemManager:SystemManager;
                
                public 
    function register(ASystemManager:SystemManager):void{
                    _SystemManager
    =ASystemManager;
                }

                    
            ]]
    >
        
    </mx:Script>
    </mx:Application>

    2.主swf的Code, SampleParent.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
        
    <mx:Script>
            
    <![CDATA[
                import mx.managers.SystemManager;
                
                
    var Children1,Children2:SystemManager;
                
                private 
    function onClick(e:Event):void{
                    SampleChildren(Children1.application).register(Children2);
                    SampleChildren(Children2.application).register(Children1);
                }

                
                private 
    function initNestedAppProps():void {
                    Children1 
    = SystemManager(myLoader.content);
                    trace(Children1.application);
                }

                private 
    function initNestedAppProps2():void {
                    Children2 
    = SystemManager(myLoader2.content);
                    trace(Children2.application);
                }

                
                private 
    function onC1(e:Event):void{
                    SampleChildren(Children1.application).CallFriend();
                }
      
                private 
    function onC2(e:Event):void{
                    SampleChildren(Children2.application).CallFriend();
                }
                  
                
            ]]
    >
        
    </mx:Script>
        
    <mx:Button label="ClickMe" click="onClick(event);"/>
        
        
    <mx:Button label="c1 call c2" click="onC1(event);"/>
        
    <mx:Button label="c2 call c1" click="onC2(event);"/>
        
        
    <mx:SWFLoader id="myLoader" width="300"
            source
    ="SampleChildren.swf"
            creationComplete
    ="initNestedAppProps();"/>
        
    <mx:SWFLoader id="myLoader2" width="300"
            source
    ="SampleChildren.swf"
            creationComplete
    ="initNestedAppProps2();"/>    
    </mx:Application>

    注意到SampleParent.mxml文件中SampleChildren類的使用了么,原來(lái)mxml文件也是對(duì)應(yīng)一個(gè)同名的actionscript class的,這個(gè)class是從Application派生的。但是要注意哦,SampleParent.mxml編譯時(shí)必須能夠看到SampleChildren類的Source。

    posted on 2008-01-04 12:27 雁過(guò)無(wú)痕 閱讀(499) 評(píng)論(0)  編輯  收藏


    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    <2008年1月>
    303112345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    導(dǎo)航

    統(tǒng)計(jì)

    常用鏈接

    留言簿(7)

    隨筆檔案

    搜索

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 国产精品亚洲视频| 亚洲免费无码在线| 18gay台湾男同亚洲男同| 亚洲人成网站观看在线播放| 久久综合AV免费观看| 久久国产乱子伦免费精品| 精品国产呦系列在线观看免费| 中文字幕无码亚洲欧洲日韩| 在线观看亚洲一区二区| 中国亚洲女人69内射少妇| 免费一级毛片在播放视频| 女人18毛片特级一级免费视频| 67194成手机免费观看| 女人隐私秘视频黄www免费| 一个人看的www视频免费在线观看| 亚洲色大成网站www| 亚洲免费中文字幕| 亚洲激情视频网站| 亚洲第一香蕉视频| 精品亚洲麻豆1区2区3区| 婷婷亚洲久悠悠色悠在线播放| 亚洲人成网站在线观看播放| 亚洲黄片毛片在线观看| 免费在线观看黄网| 国产免费卡一卡三卡乱码| 免费毛片在线播放| 日本一道高清不卡免费| 麻豆国产入口在线观看免费| 无码中文字幕av免费放| 大学生一级毛片免费看| 毛片高清视频在线看免费观看| 亚洲毛片免费观看| 青青视频观看免费99| 国产1024精品视频专区免费 | 亚洲国产中文v高清在线观看| 免费在线视频一区| 久久久亚洲精品蜜桃臀| 中文字幕亚洲专区| 人人狠狠综合久久亚洲88| 无码专区—VA亚洲V天堂| 亚洲色图.com|