在 Internet Explorer 上播放 swf 文件时出错

发布于 2024-10-11 18:44:10 字数 2543 浏览 2 评论 0原文

在下面的代码中,我收到一条错误消息 Error #2007: Parameter url must be non-null on Internet Explorer only. 我在这里做错了什么

html

  <OBJECT
                                     classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                                     WIDTH="50"
                                     HEIGHT="50"
                                     id="myMovieName">

                                   <PARAM NAME="movie" VALUE="/media/players/testsound.swf" />
                                   <PARAM NAME="quality" VALUE="high" />
                                   <PARAM NAME="bgcolor" VALUE="#FFFFFF" />

                                   <EMBED
                                      href="/media/players/testsound.swf"
             src="/media/players/testsound.swf"
             flashvars="soundUrl=sound.mp3"
                                      quality=high
                                      bgcolor=#FFFFFF
                                      NAME="myMovieName"
                                      ALIGN=""
                                      TYPE="application/x-shockwave-flash">
                                   </EMBED>
                                   </OBJECT>

mxml

 <?xml version="1.0" encoding="utf-8"?>
 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="10" minHeight="10">
<fx:Script>
  <![CDATA[

     import flash.display.Sprite;
     import flash.display.InteractiveObject;
     import flash.display.Sprite;
     import flash.media.*;
     import flash.net.*;
     import mx.controls.Alert;
     import mx.controls.Button;
     import flash.events.Event;
     import flash.media.Sound;
     import flash.net.URLRequest;

private function clickhandler(event:Event):void
     {
        var musicfile:String;
        var s:Sound = new Sound();

        //var req:URLRequest = new URLRequest(musicfile);
        s.load(req);

     }


  ]]>
</fx:Script>
<fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<!--<mx:Button id="play" label="PLAY" click="clickhandler(event)"  />-->
<mx:Image id="loader1" source="@Embed(source='/opt/cloodon/site/media/img/speaker.gif')" click="clickhandler(event)" />

</s:Application>

In the below code i get an error saying Error #2007: Parameter url must be non-null on Internet Explorer only.What am i doing wrong here

html

  <OBJECT
                                     classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                                     WIDTH="50"
                                     HEIGHT="50"
                                     id="myMovieName">

                                   <PARAM NAME="movie" VALUE="/media/players/testsound.swf" />
                                   <PARAM NAME="quality" VALUE="high" />
                                   <PARAM NAME="bgcolor" VALUE="#FFFFFF" />

                                   <EMBED
                                      href="/media/players/testsound.swf"
             src="/media/players/testsound.swf"
             flashvars="soundUrl=sound.mp3"
                                      quality=high
                                      bgcolor=#FFFFFF
                                      NAME="myMovieName"
                                      ALIGN=""
                                      TYPE="application/x-shockwave-flash">
                                   </EMBED>
                                   </OBJECT>

mxml

 <?xml version="1.0" encoding="utf-8"?>
 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="10" minHeight="10">
<fx:Script>
  <![CDATA[

     import flash.display.Sprite;
     import flash.display.InteractiveObject;
     import flash.display.Sprite;
     import flash.media.*;
     import flash.net.*;
     import mx.controls.Alert;
     import mx.controls.Button;
     import flash.events.Event;
     import flash.media.Sound;
     import flash.net.URLRequest;

private function clickhandler(event:Event):void
     {
        var musicfile:String;
        var s:Sound = new Sound();

        //var req:URLRequest = new URLRequest(musicfile);
        s.load(req);

     }


  ]]>
</fx:Script>
<fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<!--<mx:Button id="play" label="PLAY" click="clickhandler(event)"  />-->
<mx:Image id="loader1" source="@Embed(source='/opt/cloodon/site/media/img/speaker.gif')" click="clickhandler(event)" />

</s:Application>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一身骄傲 2024-10-18 18:44:11

尝试:

<PARAM NAME="FlashVars" VALUE="soundUrl=sound.mp3" />

另外,请检查这篇文章以了解 Flex 方面的内容:

Peter de Haan 关于从 Flex 获取 FlashVars 的博客文章

Try:

<PARAM NAME="FlashVars" VALUE="soundUrl=sound.mp3" />

Also, check this post for the Flex side of things:

Peter de Haan's blog post on grabbing FlashVars from Flex

别闹i 2024-10-18 18:44:11
<OBJECT
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    WIDTH="50"
    HEIGHT="50"
    id="myMovieName">

    <PARAM NAME="soundUrl" VALUE="sound.mp3" />
    <PARAM NAME="movie" VALUE="/media/players/testsound.swf" />
    <PARAM NAME="quality" VALUE="high" />
    <PARAM NAME="bgcolor" VALUE="#FFFFFF" />

    <EMBED
            href="/media/players/testsound.swf"
            src="/media/players/testsound.swf"
            flashvars="soundUrl=sound.mp3"
            quality=high
            bgcolor=#FFFFFF
            NAME="myMovieName"
            ALIGN=""
            TYPE="application/x-shockwave-flash">
    </EMBED>
</OBJECT>

上面提供了更正的代码。

您错过了对象标签的 soundUrl 参数。 IE 使用这个标签,IE 不会打扰你在 EMBED 中放入的内容。
所以,我只是将其添加到您的代码中,没有其他任何更改:

<PARAM NAME="soundUrl" VALUE="sound.mp3" />
<OBJECT
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    WIDTH="50"
    HEIGHT="50"
    id="myMovieName">

    <PARAM NAME="soundUrl" VALUE="sound.mp3" />
    <PARAM NAME="movie" VALUE="/media/players/testsound.swf" />
    <PARAM NAME="quality" VALUE="high" />
    <PARAM NAME="bgcolor" VALUE="#FFFFFF" />

    <EMBED
            href="/media/players/testsound.swf"
            src="/media/players/testsound.swf"
            flashvars="soundUrl=sound.mp3"
            quality=high
            bgcolor=#FFFFFF
            NAME="myMovieName"
            ALIGN=""
            TYPE="application/x-shockwave-flash">
    </EMBED>
</OBJECT>

Corrected code is provided above.

You missed the soundUrl parameter for the object tag. IE uses this tag, IE does not bother what you put in EMBED.
So, I just added this to your code, nothing else changed:

<PARAM NAME="soundUrl" VALUE="sound.mp3" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文