在Flash读取请求的URLFlash、URL

2023-09-08 11:57:06 作者:期待太好

我不是一个Flash开发者,但我坚持用Flash开发人员,被困在ActionScript1第三方程序。

I am not a flash developer, but I am stuck with a flash developer, stuck with a third party program in ActionScript1.

我问他要得到它嵌入Flash对象(如读取浏览器的地址栏)的页面的请求URL。然后得到的查询字​​符串变量,并将其发送回应用程序。

I asked him to get the request URL of the page which embeds the flash object (like reading the address bar in the browser). and then get Query string variables and send it back to an application.

如何阅读这些变量?请记住这是行动SCRIPT1。

How to read those variables? Remember it is action script1.

感谢

推荐答案

其实我使用的JavaScript这样的,谢谢

Actually I used javascript like this, thanks

<script type="text/javascript">
        function writeFlash()
        {
            var id = '';

            var queryString = new String();
            queryString = window.location.search;

            if (queryString != null)
            {
                var parts = new Array();
                parts = queryString.split("&");

                parts = parts[0].split("=");
                id = parts[1];

            }



            var ieObj = '<div id="flashContent">'
            + '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1200" height="800" id="BookFlipping" align="middle">'
            + '<param name="movie" value="BookFlipping.swf" />'
            + '<param name="quality" value="high" />'
            + '<param name="bgcolor" value="#ffffff" />'
            + '<param name="play" value="true" />'
            + '<param name="loop" value="true" />'
            + '<param name="wmode" value="window" />'
            + '<param name="scale" value="showall" />'
            + '<param name="menu" value="true" />'
            + '<param name="devicefont" value="false" />'
            + '<param name="salign" value="" />'
            + '<param name="allowScriptAccess" value="sameDomain" />'

            + '<PARAM NAME="FlashVars" VALUE="ID='
            + id
            + '"/>'

            + '<!--[if !IE]>-->'
            + '<object type="application/x-shockwave-flash" data="BookFlipping.swf" width="1200" height="800">'
            + '<param name="movie" value="BookFlipping.swf" />'
            + '<param name="quality" value="high" />'
            + '<param name="bgcolor" value="#ffffff" />'
            + '<param name="play" value="true" />'
            + '<param name="loop" value="true" />'
            + '<param name="wmode" value="window" />'
            + '<param name="scale" value="showall" />'
            + '<param name="menu" value="true" />'
            + '<param name="devicefont" value="false" />'
            + '<param name="salign" value="" />'
            + '<param name="allowScriptAccess" value="sameDomain" />'

            + '<PARAM NAME="FlashVars" VALUE="ID='
            + id
            + '"/>';

            + '<!--<![endif]-->'
            + '<a href="http://www.adobe.com/go/getflash">'
            + '<img src="https://m.xsw88.com/allimgs/daicuo/20230908/604.png.gif" alt="Get Adobe Flash player" />'
            + '</a>'
            + '<!--[if !IE]>-->'
            + '</object>'
            + '<!--<![endif]-->'
            + '</object>';

            //alert(ieObj);
            document.write(ieObj);


        }
    </script>


<body>

    <script language="JavaScript" type="text/javascript">
    <!-- 
    writeFlash();
    -->
    </script> 


</body>