Web Hosting Talk







View Full Version : Inserting a .swf using HTML


HTMLnoobAlex
07-01-2004, 03:51 PM
Hello,

Im not very good at my HTML, i know enough to build a basic website but i want to insert a flash file into my website and i dont have a clue how to do it, its a .swf file extension.

Any help would be greatly welcome,

Thanks in advance,

Alex

the_pm
07-01-2004, 04:01 PM
Flash provides the HTML to do this, and other programs should do this as well. Look for the appropriate option when publishing your .swf

Christina
07-01-2004, 04:18 PM
You should really export your .swf with an html file but if you can't for some reason, this should help:

http://www.macromedia.com/support/flash/ts/documents/tn4150.html

unlucky1
07-01-2004, 04:30 PM
I believe <img src="image.swf" alt="" /> should work.

Christina
07-01-2004, 04:40 PM
The <img> tag is for images, it won't call a .swf file.

the_pm
07-01-2004, 04:47 PM
However, theoretically speaking, you should be able to use the <object> tag (used to call .swf files) to call images as well. In fact, the <object> tag was originally created to make <img> obsolete. It is meant to be the generic calling agent to replace object-specific elements. How about that?

Of course, <embed> is even better recognized for calling Flash files, and (IIRC) it's not even a part of the latest HTML spec!

So confusing...

Paul H

Christina
07-01-2004, 04:52 PM
Just an example, usually the code from the published files will have the object attribute etc etc around it

<embed src="whatever.swf" menu="false" quality="best"
scale="noscale" bgcolor="######" width="###" height="###" name="sageheader" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />


blah blah blah

l3vi
07-01-2004, 06:10 PM
The best way to go, if you want to have XHTML 1.0 compliant code, is to use this code (its long, I know):

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="widthpx" height="heightpx">
<param name="movie" value="yourmovie.swf" />
<param name="quality" value="high" />

<param name="bgcolor" value="#FFFFFF" />
<!--[if !IE]> <-->
<object data="yourmovie.swf"
width="widthpx" height="heightpx" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
FAIL (the browser should render some flash content, not this).
<!--> <![endif]-->
</object>

HTMLnoobAlex
07-01-2004, 06:57 PM
Thank you,

Alex

driada
07-02-2004, 05:14 AM
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="....." height="....">
<param name="movie" value="file name.swf">
<param name="quality" value="high">
<embed src="file name.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="..." height="...."></embed>
</object>
u can use such simple cod
good luck