Log in

View Full Version : css - instead of gif baner - .swf baner



Ex-Spirit
11-27-2006, 02:12 PM
In css I have this code:


#content {
background: url(body.gif) center repeat-y;
position : absolute;
left : 50%;
width : 700px;
margin-left : -350px;
}

How can i change body.gif to use .swf instead of this?
If I change .gif to .swf it won't work.. It doesn't show the swf... It needs to change the "background: url(body.gif) center repeat-y;", since swf can't be displayed as backgorund right?

BLiZZaRD
11-27-2006, 08:21 PM
No, because the SWF needs to be embeded i the page.

You could embed it in an external .js file and call that, although I have never seen/attempted this, it's just a hunch..

djr33
11-27-2006, 09:22 PM
.swf, like movie clip objects, applets, etc. is not a format natively supported in browsers.
Just like a .bmp or .psd don't display in an image tag, .swf won't either.

The formats, to my knowledge, that ARE supported, are only .gif, .jpg (.jpe and .jpeg as well), and .png.

.swf can be the banner, but only as an object in the page.

Look up the html code for embedding and object, and it should include both the <embed> and <object> tags for most support.

Also, if you're using flash, then there is an option, somewhere in the saving menu, I think, to export as a webpage, so it will automatically generate that code for you. Just copy/paste that block of html into your page, and that should work.

BLiZZaRD
11-28-2006, 10:02 PM
Also, if you're using flash, then there is an option, somewhere in the saving menu, I think, to export as a webpage, so it will automatically generate that code for you. Just copy/paste that block of html into your page, and that should work.

Yes, just FYI its in the publish settings menu:

File >> Publish Settings >> check HTML box >> Publish.

Then you can open/edit the html page it makes.

On a side note though, the <embed> tag wont validate, and there is a new way around that. in the <object>...</object> secion just add (or verify it is there) the param tag like this:



<param name="movie" value="movie name.swf" />


Where "movie name" is the same name as the id="" in the opening <object classid....> part.

djr33
11-28-2006, 10:48 PM
Good to know.
I'm stunned... you'd think that a WYSIWYG editor developed by macromedia/adobe (or at least it's counterpart) would at LEAST have validating code for their own proprietary format.
That's crazy.

BLiZZaRD
11-28-2006, 11:11 PM
Well it might be different now that there are ways, I am still using Flash from 2 versions back, so I get what was cool and hip at that time :)