开发者

Object tag auto hidden, why?

开发者 https://www.devze.com 2023-01-11 01:55 出处:网络
I am trying to place flash swf into my html through php but when the page loads the f开发者_StackOverflow社区lash file is hidden. I can hear the sounds and music but it is not visible.

I am trying to place flash swf into my html through php but when the page loads the f开发者_StackOverflow社区lash file is hidden. I can hear the sounds and music but it is not visible.

Here is the code I am using:

'<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
                <script type="text/javascript">
        swfobject.registerObject("game", "10.0.0");
                </script>
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$gameWidth.'" height="'.$gameHeight.'" id="game">
            <param name="movie" value="'.__BASE_URL.'games/'.$gameFile.'" />
                            <param name="wmode" value="transparent" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="'.__BASE_URL.'games/'.$gameFile.'" width="'.$gameWidth.'" height="'.$gameHeight.'">
                                <param name="wmode" value="transparent" />
            <!--<![endif]-->
                <a href="http://www.adobe.com/go/getflashplayer">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                </a>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object><br/>'

Here is the styles I am using on it:

 #game{
      background-color: #fff;
 }

When I load it and check the source this is added:

element.style {
     visibility:hidden;
}
#game {
     visibility:hidden;
}

How do I prevent this?


I figured it out, the problem was with the swfObject. For some reason it was hiding the file so I added this line to my javascript file:swfobject.switchOffAutoHideShow();, this seems to fix the problem. I still don't know why it was doing it in the first place though.

0

精彩评论

暂无评论...
验证码 换一张
取 消