Load together Image and SWF file using css as Background
I would like to load the image which i have prepared and the Flash swf file at the same time. I am loading image using CSS Stylesheet and as background. But when i tried to do the same thing with SFW file it could not load together.
Any one knows how to load image and SWF file together using CSS. The image currently coming as following
#content{
margin: 0;
padding: 160px 0 0 0;
background: url(content_top.jpg) left top no-repeat;
}
and i have tried to do following :
#content{
margin: 0;
padding: 160px 0 0 0;
background: url(content_top.jpg) left top no-repeat;
backgound-ulr: {content.swf);
load: swf;
}
thanks for your attention, sorry i was in balckout for last 4 to 5 days as ISP was down. Well, i have managed to load the flash object as an object in DIV tag using normal way but my drop down menu appears behind the flash file so i can not see and use some of the links under particular tab as they appear behind the flash file.
could you pleaseshow me some way to over come this issue. please find following code which i have used.
#navbar ul ul li, #navbar .active ul li{
background: #ececec!important;
padding: 0;
}
#navbar ul li.active{
background: url(nav_active.png) left bottom no-repeat;
}
#navbar ul li.active a{
background: url(nav_active.png) right bottom no-repeat;
color: #fff;
}
#navbar ul ul a, #navbar ul ul a:visited, #navbar li.active ul a, #navbar ul .active ul a{
font-weight: normal!important;
background: #ececec!important;
color: #254c8b;
border-right: 1px solid #ddd;
border-left: 1px solid #ddd;
border-bottom: 1px solid #ddd;
display: block;
height: auto;
line-height: 20px;
padding: 0 10px 0 10px!important;
margin: 0 0 0 0;
width: 130px;
}
* html #navbar ul ul a, * html #navbar ul ul a:visited {
width: 150px;
width: 128px;
}
#navbar a:hover{
color: #333!important;
}
#navbar ul ul a:hover, #navbar ul a.active ul a:hover{
background-color: #ccc!important;
color: #fff!important;
text-decoration: none;
}
#navbar :hover > a, #navbar ul ul :hover > a {
color: #333!important;
}
#navbar ul li:hover ul,
#navbar ul a:hover ul {
visibility: visible;
}
CSS CODE FOR FLASH & IMAGE
#content{
margin: 0;
padding: 10px 0 0 0;
background: url(content_top.jpg) left top no-repeat;
/* background: url(content_org.jpg) left top no-repeat;
/* background-ulr: {banner2_top.swf) center no repeat;
load: swf; */
}
For starters, give you Flash object a window mode.
Window Mode (wmode) - What's It For?
There are three window modes.
Window
Opaque
Transparent
By default, the Flash Player gets its own hWnd in Windows. This means that the Flash movie actually exists in a display instance within Windows that lives above the core browser display window. So though it appears to be in the browser window, technically, it isn't. It is most efficient for Flash to draw this way and this is the fastest, most efficient rendering mode. However, it is drawing independently of the browser's HTML rendering surface. This is why this default mode (which is equivalent to wmode="window") doesn't allow proper compositing with DHTML layers. This is why your JavaScripted drop-down menus will drop behind your Flash movie.
In windowless modes (like opaque), Flash Player doesn't have a hWnd. This means that the browser tells the Flash Player when and where to draw onto the browser's own rendering surface. The Flash movie is no longer being rendered on a higher level if you will. It's right there in the page with the rest of the page elements. The Flash buffer is simply drawn into whatever rectangle the browser says, with any Flash stage space not occupied by objects receiving the movie's background color.
If that doesn't cure the problem, then revisit the positioning css.
Best wishes,
EfV
Hi , that thing did helped but after that the left part of the flash is not visible. It gets cut. I have tried changing and playing with all Like height, width, alignment, also tired the same things on <div>tag and tried in CSS too. no luck.
One morething i would like to know have you ever tried calling/loading SWF file using css.
is there any way to load it normally. I look forward to hearing from you. many thanks.
Originally Posted by Eye for Video
For starters, give you Flash object a window mode.
Window Mode (wmode) - What's It For?
There are three window modes.
Window
Opaque
Transparent
By default, the Flash Player gets its own hWnd in Windows. This means that the Flash movie actually exists in a display instance within Windows that lives above the core browser display window. So though it appears to be in the browser window, technically, it isn't. It is most efficient for Flash to draw this way and this is the fastest, most efficient rendering mode. However, it is drawing independently of the browser's HTML rendering surface. This is why this default mode (which is equivalent to wmode="window") doesn't allow proper compositing with DHTML layers. This is why your JavaScripted drop-down menus will drop behind your Flash movie.
In windowless modes (like opaque), Flash Player doesn't have a hWnd. This means that the browser tells the Flash Player when and where to draw onto the browser's own rendering surface. The Flash movie is no longer being rendered on a higher level if you will. It's right there in the page with the rest of the page elements. The Flash buffer is simply drawn into whatever rectangle the browser says, with any Flash stage space not occupied by objects receiving the movie's background color.
If that doesn't cure the problem, then revisit the positioning css.
Best wishes,
EfV
Last edited by ontljoshi; 11-09-2009 at 12:24 PM.
Reason: css bit
What do you mean it gets cut off? By what? What are the dimensions of the .swf? What are the dimensions of the <div> that's holding the .swf? What is the 80% width in the Flash params for? Any change in width or height of the .swf will result in a proportionate change in width or height in order to maintain the same aspect ration as the original. So for example, you can make it narrower but it will also become shorter.
No I do not load swfs with CSS, instead I would recommend using swfobject: http://code.google.com/p/swfobject/
Best of luck to ya!
EfV
hi efv, i have tried but can't find any thing....i tried chaning width parameter but it did not affect anything so i tried after removing width it was the same thing i.e. no change in appearance. I have attached the image with this for better idea.
Also wants to know about effect wmode=opaque in firefox, as it did worked in IE but not in firefox. any other settings required. To get the same output as IE.
Looking forward to hearing from you. many thanks.
Last edited by ontljoshi; 11-10-2009 at 07:49 AM.
Reason: for Firefox
From the code posted above, I was not able to reproduce the problem. The Flash displayed just fine. To get the Flash to display the same in IE and FF, you need to add the window mode to both the <object> and the <embed>
Code:
<param name="wmode" value="transparent"/>
and
Code:
wmode="transparent"
to the <embed>
Looking at the attached screen shot of the page, I can see part seems to be cut off but I also noticed the scroll bar at the bottom of the page. Apparently part of the page is sticking way out to the right of the rest of the content. I would suggest that you work with just a section of the page to fix first the Flash and then the width issue.
Start with a blank page and just put in your wrapper the navigation and an empty <div> the size of the Flash, but without the Flash content. Give it a background color so you can see what it's doing. Get that section working before adding any other content.
For more help, post a link to the page, it seems that the code posted above must have the bottom cut off, because there are several <div> that are not closed.
Best wishes,
EfV