【问题标题】:how can I call mxml application from actionscript [duplicate]如何从 actionscript 调用 mxml 应用程序 [重复]
【发布时间】:2013-05-29 05:55:15
【问题描述】:

我有 main.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>

请告诉我该怎么做。感谢您的帮助!

【问题讨论】:

    标签: actionscript-3 apache-flex adobe mxml


    【解决方案1】:

    让两个应用程序通信的一种简单方法是LocalConnectionDocumentation here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-27
      • 2014-04-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 1970-01-01
      • 2011-05-03
      相关资源
      最近更新 更多