【问题标题】:Open custom IE window from Flex or Can a window customize itself?从 Flex 中打开自定义 IE 窗口或窗口可以自定义吗?
【发布时间】:2009-11-11 00:21:13
【问题描述】:

是否可以在 flex 中打开自定义 IE 窗口(即没有状态栏或地址栏等)?或者如果我调用一个 php 文件或 html 文件,页面可以在加载时自定义吗?

【问题讨论】:

    标签: php javascript html apache-flex


    【解决方案1】:

    您可以使用 HTTPService 调用 php 或 html 文件。

    import mx.rpc.http.HTTPService
    
    
    <mx:HTTPService method="post" url="{php path}" resultFormat="e4x" ShowBusyCursor="true" />
    

    php 或 html

    <?php
    
    echo "<script>window.open('url path','mywindow','width=400,height=200,scrollbars=no, toolbar=no,menubar=no')</script>";
    
    
    ?>
    

    请检查小错误。

    希望有帮助

    【讨论】:

    • 您好 Treby,我不太确定 PHP 文件的 POST 方法将如何工作...在浏览器中调用的 php 代码工作但在 Flex 代码中不工作。我做了进一步的研究,相信我应该能够使用 ExternalInterface 函数将 javascript 放入 Flex,但也不确定。
    • 你可以忽略method="post",只需将url路径放在php或html中即可。而在 html 方面,你只需将代码放在
    【解决方案2】:

    Flex 应用程序所在的 HTML 页面中的 JavaScript..

    <script language="JavaScript" type="text/javascript">
    function images(url) 
    {
     var width  = 700;
     var height = 500;
     var left   = (screen.width  - width)/2;
     var top    = (screen.height - height)/2;
     var params = 'width='+width+', height='+height;
     params += ', top='+top+', left='+left;
     params += ', directories=no';
     params += ', location=no';
     params += ', menubar=no';
     params += ', resizable=no';
     params += ', scrollbars=no';
     params += ', status=no';
     params += ', toolbar=no';
     newwin=window.open(url,'Screenshots', params);
     if (window.focus) {newwin.focus()}
     return false;
    }
    </script>
    

    以及点击按钮时调用的 flex 函数...

    private function imagesButtonClick():void {
        var url:String = data.images;
        ExternalInterface.call("images", url);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-07
      • 2023-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-17
      相关资源
      最近更新 更多