Flash Valid XHTML Part 1
Saturday, January 7th, 2006How to: Valid Flash object markup in XHTML 1.0 Strict.
Call this the “Basic Method”. This is the down and dirty, basic means to get your Flash to validate, play in all of the major browsers, and render properly with very little hassle.
More in depth articles are to follow, but we shall start right here. This is the very most basic means that I know of. I have many times been asked about this, and challenged redundantly. This is the easiest and most basic means that I have developed to date.
This method will work in XHTML 1.0 Strict, also for the Transitional DTD. If you remove the self-closing tags, this method is good for the 4.0 and 4.01 DTD as well.
Without getting too very deep into this subject, I’d like to say, I do not use this method very often anymore. I have developed an even slicker approach since I came up with this one. But, for brevity and to get you started in the right direction, I offer this method to you. Look for more detailed or complex methods in the Archives under the Flash-SWiSHmax category. (This is a topic of interest to me; this category will be a pet project of mine.)
As I said, this is the basic, down and dirty method.
The Need
Dreamweaver, Flash MX, SWiSHmax, etc. do not by default, produce valid output for Flash markup. They never have, to my knowledge. Dreamweaver and Flash MX can be configured to do so, but at the time of this writing, they do not by default do so. This is very problematic to authors whom care about standards based product. Until software vendors begin to ignore browser issues from the time of Dinosaurs, (Netscape 4, Internet Explorer 5.0, etc), and move on to modern standards… we as end users must come up with our own solutions apparently. Here is one of those now:
The Object Markup
A quick breakdown of the required elements for displaying our movie:
——————————
object type=”application/x-shockwave-flash”
Defines the object type, in this case, Flash.
codebase=”http://download.macromedia.com/ - etc.”
Defines the file build version that we have output from our Flash editor. This also prompts a pop-up for users that do not have a player version that is current enough to play the Flash movie. The pop-up offers the user a choice to upgrade to the newest Player version from Macromedia/Adobe.
data=”http://file-path/movie.swf”"
Defines the file path to our Movie file. Please use an absolute file path, as opposed to a relevant one. i.e. - The full URL instead of just the file name, even if the file resides in the same directory as the web page that is calling for it.
width=”760px” height=”500px”
Defines the pixel size of the movie display in the page.
param name=”movie” value=”http://file-path/movie.swf”
Again, this time for Firefox, Netscape and Opera, defines the file path.
a href=”http://www.macromedia.com/go/getflashplayer”
Offers an opportunity for users to get Flash Player if they do not have it, or for us to place alternative content for those who do not want it.
/object
Closes the object.
——————————
All of those elements are not required to run Flash in our pages. For a basic and full set though, this will work.
Here is an example of a full object markup snippet for you to use, just copy this and edit it to reflect your own file name, pixel sizes, and absolute file path: (This symbol “X” designates areas you will need to edit.)
Sample File of Flash Markup for You to Use.
(Opens in New Window, just close it when you’re finished.)
Note: You may choose to omit some of the optional parameter attributes and values, or add in any others that you need.
This method will indeed validate if implemented into your markup correctly.
