Reputation: 67852
I have a flex app that I want to hide in a div until the user clicks a link or element of some type. I've noticed that embedding the swf in a div with style display:none does not actually hide the swf, so how would I go about accomplishing this?
The goal is to have the flex app loading in the background while the user does other things. Thanks.
Upvotes: 1
Views: 4084
Reputation: 95424
Try setting the following wmode
to your flash object, and use visibility: hidden;
as well.
<param name="wmode" value="opaque" />
<embed ... wmode="opaque" ... />
By default, flash basically overlays a window over your content, which is:
display: none; visibility: hidden;
to the <object>
tag will work).By setting wmode
to opaque
, it basically tells flash to treat your <object>
as a normal DOM tag, which responds to normal inheritance and z-index rules. It has a very small performance cost.
Also, note that some browsers will not load the object until it is displayed.
Upvotes: 5
Reputation: 19344
I usually just force the height/width of the container to 1 by 1 px...
<div style="height:1px; width:1px;" >... flash goes here ...<div>
Then, when I need the flash, I will re-set the height/width as appropriate. Note, you may want to put this into a parent container if you want to just reset the hw to "100%" which will bind to a parent div, with a "position:relative; height:?px; width:?px" setting.
Upvotes: 2