views:

21

answers:

2

I am trying to place flash swf into my html through php but when the page loads the flash 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"&gt;&lt;/script&gt;
                <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"&gt;
                    <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?

A: 

Are you using any flash-blocking extensions in your browser?

Gareth
This is more of a comment than an answer.
JKirchartz
I am using ad-blocker with google chrome, but I can hear the music and sounds of the game. I get the same thing with firefox and it does not have a blocker.
WAC0020
A: 

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.

WAC0020