0

How can I embed a Flash SWF file into an HTML page without using JavaScript libraries?

The Flash movie is an advertisement which will run on sites that don't have any JavaScript libraries available (like SWFObject). My only capability is to render a piece of HTML using document.write. I do not wish to add any external script tags (or write them for that matter).

The browser requirements are basically "all browsers":

  • IE6+
  • FF2+
  • Chrome, Safari (WebKit)
  • Recent version of Opera (not 100% required)

I do not care about validation. The only goal is to make it work reliably.

3 Answers 3

2

use <object> <object/> & The OBJECT tag is used by Internet Explorer on Windows,EMBED is used by Netscape Navigator (Macintosh and Windows) and Internet Explorer (Macintosh) tag like this:

<object type="application/x-shockwave-flash" data="myclip.swf"> 
    <param name="movie" value="myclip.swf" />
    <param name="quality" value="high" />
    <!-- Sandwich the embed tag inside the object tag -->
    <embed src="myclip.swf" quality="high" />
</object>
Sign up to request clarification or add additional context in comments.

Comments

0

I think it works quite reliably with an <iframe>.

<iframe src="myclip.swf" width="300" height="200" border="0" />

http://jsfiddle.net/ZZ5Pk/ (Warning: Loud SWF)

Comments

0
<object width="400" height="400" data="helloworld.swf"></object>

This will work on all browser, although I will suggest you to avoid using <embed> tag, as Firefox doesn't support that. You can learn more about <object> tag from link below.

http://www.w3schools.com/tags/tag_object.asp

1 Comment

Wrong. <object> tag alone is the one that is not supported in Firefox nor in Opera. On a personal note, I would recommend you to start using good reference materials (such as Mozilla Developer Network or W3C Documentation)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.