我如何从actionscript调用mxml应用程序



MXML,其中有登录按钮。如下图-

            <mx:Script>
    <![CDATA[
        private function onSuccessfulLogin(event):void {
            // How to call second mxml application*/
                }
    ]]>
</mx:Script> 
<mx:Panel x="414" y="145" width="355" height="200" layout="absolute"
          title="Enter Your Login Information">
    <mx:TextInput id="textInputName" x="147" y="12"/>
    <mx:TextInput id="textInputPassword" x="147" y="57"/>
    <mx:Button x="142" y="115" label="Login" id="callToServer" 
    <mx:Label x="37" y="14" text="User Name"/>
    <mx:Label x="41" y="59" text="Password"/>
</mx:Panel>

现在成功登录后,我想调用另一个mxml应用程序,例如second.mxml。它看起来像-

     <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
            xmlns="*" creationComplete="iFrame.visible=true"  
      viewSourceURL="srcview/index.html"> 
      <mx:HBox width="100%" height="100%">
     <mx:Panel title="/ Company Home" width="200" height="100%" >
         <mx:Tree id="tree" width="100%" height="100%" dataProvider="{treeData}"
                 labelField="@label" showRoot="false"
                 change="iFrame.source = 
      (Tree(event.target).selectedItem.attribute('path').toString());"  />
      </mx:Panel>
      <mx:Panel width="100%" height="100%" title="Ticket Details" >
        <IFrame id="iFrame" source="some url" width="100%" height="100%"  />
       </mx:Panel>
       </mx:HBox>
       </mx:Application>

请让我知道我该怎么做。谢谢你的帮助!

让两个应用程序通信的一个简单方法是LocalConnection文档在这里

最新更新