PDA

View Full Version : WC3 validation of flash movie...



bizzydint
01-06-2004, 06:28 AM
it's giving me grief and unforunately i *have* to get the page to validate! So I hope someone will help.

I've currently got a bit of javascript to detect if the user has a good enough version and then display the movie, otherwise it shoudl just display a static image.

So far the relevant code is:



document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='640' height='160' id='ftMc' align='middle'>");
document.write("<param name='allowScriptAccess' value='sameDomain'>");
document.write("<param name='movie' value='flashIntro.swf' >");
document.write("<param name='loop' value='false' >");
document.write("<param name='quality' value='high' >");
document.write("<param name='bgcolor' value='#fcd957' >");
document.write("<embed src='flashIntro.swf' loop='false' quality='high' name='ftMc' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
document.write("</object>");



The WC3 validator just insists on telling me that I have closed the OBJECT tag without opening it!

However, I took it out of the javascript bit, and I get even more errors - most of the EMBED tag attributes arent recognised for some reason.

Any help, suggestions or pointers would be greatly appreciated.

Cheers.

bizzydint
01-06-2004, 08:43 AM
i managed to stop the errors showing on the validation report. It was the javascript causing the grief. The closing object tag wanted to be written as
<\/OBJECT> instead of just </OBJECT>
see this page for more info: http://www.htmlhelp.com/tools/validator/problems.html#script

however, I havent tackled the fact that if you remove the html out of the javascript and just display the flash with no detection, there are several validation errors. But as long as it works, I'm not going to waste any more time...

poab
01-06-2004, 10:59 AM
This is a great essay:

http://www.alistapart.com/articles/flashsatay/

cheers.

greeneagle
01-27-2004, 09:42 AM
poab,
I went to the article you suggested and have tried the suggestions. Although better still have one problem validating a page!

Trying to validate “Markup” on a DreamweaverMX Studio Page with 2 small Flash movies using Dreamweaver validation check:
Obviously had a problem with old code and “<embed>” as follows:

<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="750" height="140">
<param name="movie" value="HeaderIndex.swf">
<param name="quality" value="high">
<embed src="HeaderIndex.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"
width="750" height="140"></embed>
</object>

Severity Description Line
Error The tag:"embed" is not allowed within: "object" It is only allowed within: . 94
Error "header.swf" is not valid value for the "src" attribute in any of the currently active
versions. See the above warnings for more details. 94
Error The tag: "embed" doesn't have an attribute: "quality" in currently active versions. 94
Error The tag: "embed" doesn't have an attribute: "pluginspage" in currently active versions. 94
Error The tag: "embed" doesn't have an attribute: "type" in currently active versions. 94
Error "750px" is not valid value for the "width" attribute in any of the currently active versions.
See the above warnings for more details. 94
Error "140px" is not valid value for the "height" attribute in any of the currently active versions.
See the above warnings for more details. 94

Changed to:

<object
type="application/x-shockwave-flash" data="movie.swf"
width="400" height="300">
<param name="movie" value="movie.swf" />
</object>

and still have a problem:

Severity Description Line
Error The tag name: "objecttype="application/x-shockwave-flash"" Not found in currently active
versions. 94

Is there any way past this?, anyone have suggestions? or is it just not possible to validate a page with a Flash movie?

Thanks,
Ken

mikmik
01-27-2004, 05:55 PM
Green eagle wrote that this does not validate :
<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="750" height="140">
<param name="movie" value="HeaderIndex.swf">
<param name="quality" value="high">
<embed src="HeaderIndex.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"
width="750" height="140"></embed>
</object>

So if you take all of the code here, and remove it to a text file, and name it 'embed.js', where 'embed' is any name you give it - 'yourname.js'.
Then you can put " <script type="text/javascript" src="pathTo/folder/yourname.js"><script/> " in your page where the SWF goes.
I get around to much like this, but I have javascript that doesnt validate, aned it is a QUIRK WITH THE VALIDATOR.

greeneagle
01-28-2004, 01:37 AM
I got it to validate (Dreamweaver)like this:

<object type="application/x-shockwave-flash" data="movie.swf"
width="750" height="140">
<param name="movie" value="header.swf" >
</object>

It's funny that many ways Dreamweaver does things won't validate to their on validation criteria!

Both movies are so small that IE's streaming problem will not effect the outcome in this case.

I'll try it W3C in the next couple days.

Thanks,
Ken