Initial white screen

400 views
Skip to first unread message

leopavan

unread,
May 28, 2009, 9:46:04 AM5/28/09
to SWFObject
Hi,
I have a page with a black background, I'm using the swfobject to
insert a swf dynamically. The problem is that a white screen appears
at beginning before the swf loads.

The html code is:

<html>
<head>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("test.swf", "content", "400px", "300px",
"9.0.0", false);
</script>
</head>
<body style="background-color:#000000">
<div id="content"> </div>
</body>
</html>


The example with the error is on http://qa.neubloc.pl/public/whiteissue.html

Thanks

Aran Rhee

unread,
May 28, 2009, 8:27:30 PM5/28/09
to swfo...@googlegroups.com
The white background seems to be coming from within the swf, not the page.
 
You can set the bgcolor parameter to black in the params object passed into the embedSWF() call. Or you can set the BG color in the Flash IDE, or draw a shape in Flash and set the color there.
 
Aran 

Vincent Polite

unread,
May 28, 2009, 8:36:23 PM5/28/09
to swfo...@googlegroups.com
Generally speaking, your issue is because of a lack of style definition on your content div.  It may also require that you invoke the wmode=transparent attribute or a background-color attribute on your swfobject reference.

SWFObject actually programatically replaces/erases the existing <div id="content"></div> and replaces it with the object definition that you defined.  The swfobject.embedSWF call you make doesn't appear to have any attributes or parameters that would tell the browser to provide a black background color or (as an alternative) let the .swf object render as transparent.  (I'd recommend the black background color over the wmode=transparent option due to problems that causes, although in your case, I doubt it will be an issue).

Take a look at:  http://code.google.com/p/swfobject/wiki/documentation

Go down to the section: 

How to embed Flash Player content using SWFObject dynamic publishing

and check out Step 3 where it discusses adding attributes and parameters.  Specifically you will want to add a style definition where the background-color is set to what you want.  I believe that should get rid of your white box flash problem....

There's a code generator that should help you out for situations like this.  If you use the generator and open up the attributes/parameters adding section of the form, then the code it generates should clarify what I'm saying.

Best,

Vincent Polite

Leonardo

unread,
May 29, 2009, 2:46:45 PM5/29/09
to SWFObject
Thanks guys!! I was trying to set the bgcolor with bgcolor = 0x000000,
but flash seemed to ignore it. Now I tried with "#000000" and it works
fine.
Thank you very much

Best Regards,
Leonado

On 28 mayo, 21:36, Vincent Polite <vpol...@socialnetconnect.com>
wrote:
> Generally speaking, your issue is because of a lack of style definition on
> your content div.  It may also require that you invoke the wmode=transparent
> attribute or a background-color attribute on your swfobject reference.
>
> SWFObject actually programatically replaces/erases the existing <div
> id="content"></div> and replaces it with the object definition that you
> defined.  The swfobject.embedSWF call you make doesn't appear to have any
> attributes or parameters that would tell the browser to provide a black
> background color or (as an alternative) let the .swf object render as
> transparent.  (I'd recommend the black background color over the
> wmode=transparent option due to problems that causes, although in your case,
> I doubt it will be an issue).
>
> Take a look at:  http://code.google.com/p/swfobject/wiki/documentation
>
> Go down to the section:
> How to embed Flash Player content using SWFObject *dynamic publishing*and
> check out Step 3 where it discusses adding attributes and parameters.
> Specifically you will want to add a style definition where the
> background-color is set to what you want.  I believe that should get rid of
> your white box flash problem....
>
> There's a code generator that should help you out for situations like this.
> If you use the generator and open up the attributes/parameters adding
> section of the form, then the code it generates should clarify what I'm
> saying.
>
> Best,
>
> Vincent Polite
>
Reply all
Reply to author
Forward
0 new messages