views:

115

answers:

1

I have a simple movie that has a tiny bit of Actionscript 2.0.

  1. What is the best way to embed a flash movie for XHTML compliance?
  2. Which version should I export for?

The code that Flash automatically outputs is so bloated, I'm not sure what I need. Also, I noticed that a Macromedia URL is in the code, and now that Adobe owns Flash, I wonder if this is a mistake.

A: 

The best way to embed a flash file in HTML is using swfobject by Google : http://code.google.com/p/swfobject/

In the end it goes like :

<script type="text/javascript">

var flashvars = {
  name1: "hello",
  name2: "world",
  name3: "foobar"
};
var params = {
  menu: "false"
};
var attributes = {
  id: "myDynamicContent",
  name: "myDynamicContent"
};

swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);

</script>

Hope that helps

marcgg
I really like that swfobject idea
Andrew