PDA

View Full Version : Validating flash .swfs



obuwebco
07-07-2004, 07:06 AM
is there anyway surefire way to get Flash .swf files to validate. My page is fully validating EXCEPT the .swf as you know if u ever tried it.

Is there a good way to get flash to validate?

ITGProductions
07-14-2004, 11:32 AM
Not sure exactly what your using for apps but here it is from the horses mouth if you will: http://www.macromedia.com/support/flash/programs/form_validations_tut/

hope this helps...

poab
07-27-2004, 09:19 AM
Hi,

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

cheers.

voodooboy
07-27-2004, 04:46 PM
Poab,
While that is a great article. The writer constantly refers to the bloating of his pages due to the code. The code itself, placed in a html file with just the standard coding for an empty html page, is just a meer 700 bytes. That is nothing, when considering the file size of the flash document itself.

My thought is that if you are going to be that anal about validation, then don't put Flash in your site.

Can you validate a Quicktime file? Can you validate a .PDF or .PPT file? Flash is an interactive media and is not designed to be validated. So if you want perfect validation then stick with xhtml and leave the Flash out.

poab
07-29-2004, 09:20 AM
Can you validate a Quicktime file? Can you validate a .PDF or .PPT file? Flash is an interactive media and is not designed to be validated. So if you want perfect validation then stick with xhtml and leave the Flash out.


The issues not with flash it's with the markup needed to embed the flash.

Just trying to answer the query.

voodooboy
07-29-2004, 10:28 AM
The issues not with flash it's with the markup needed to embed the flash.

Just trying to answer the query.

And you did that; very well. I did not know about that article myself and found it very interesting.

Poab,
Don't get me wrong. I am not challenging you or your intentions. As I said before, that was a great article and something I am interested in looking into further.

What I am doing is making a blanket statement (to everyone) to make the point that if someone is so concerned about complete validation, then don't put Flash in your site. The point being that validation is not perfect. There will always be issues with code in one browser or another. The issue of trying to validate the embedding of a non-validatable item is just dumb. IMHO.

Let's say you validate the embedding code for Flash down to three simple lines. You optimized and validated away until the only thing left was exactly what was needed. (which is what is in the article) What is to say that your viewers are going to have the version of Flash player needed to run your Flash file? Drew McLellan's article covers this point. But it requires adding code and additional files back into the equation. Where is the benefit there? If you are only adding more bulk to the entire site size just to lean out a mere 14 bytes worth of code, then why bother?

All this for the sake of validation? Again, validation in and of itself is flawed. It is not now nor will it ever be perfect. So why worry about 14 bytes of code if everything else works and complies with the validation specs?

poab, please remember, I am not challenging you personally or your reason for posting. I know you were trying to help, and you did. You provided exactly what was asked for and it is beneficial information. I would just like to discuss the reasoning behind the struggle for validation. In fact I encourage debate on this subject. Especially when it pertains to the use of Flash in a web site.

turtlwaX
08-04-2004, 03:37 PM
i have found a way to validate an html 4.0 page containing flash content

perhaps not the best....but it does seem to work and does not really require all that is below, but simply to use javascript to write the object/embed tags using document.write.

however....i will explaing the implementation of this method on http://www.canusa.net

so... detect for flash player using an old method provided by macromedia that utilizes an external javascript file and vbs file.

http://www.canusa.net/dispatcher.js
http://www.canusa.net/dispatcher.vbs

in the HTML page with flash, call on function

MM_flashInfo();

This function returns an array containing the following:

flashInfo = new Array();
flashInfo[0] = this.installed; // is flash installed
flashInfo[1] = this.implementation; // java or activeX
flashInfo[2] = this.autoInstallable; // is it autoinstallable for this browser
flashInfo[3] = this.version; what player version number
flashInfo[4] = this.revision; what player revision number

Then in my page I run the following javascript

if ((flashInfo[0]) && (parseInt(flashInfo[3]) >= 6)){
document.write(flashMenu);
} else {
document.write(htmlMenu);
}

This determines if the flash player is installed, and if its' version is greater than or equal to 6 (change the 6 to whatever version you are targeting and extend the if statement if you want check against revisions or other attributes). If both conditions are met then I document.write the javascript variable flashMenu ( which contains the html with object and embed tags) else.... give the user the alternate content.

my variable flashMenu looks like this:

flashMenu = '<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="top" align="left" height="214" width="780">'
flashMenu += '<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="780" HEIGHT="214" id="fl_header" ALIGN="" swliveconnect="true">';
flashMenu += '<PARAM NAME=movie VALUE="flashUI/fl_header.swf?imgName=fl_image4.swf">';
flashMenu += '<PARAM NAME=loop VALUE=false>';
flashMenu += '<PARAM NAME=menu VALUE=false>';
flashMenu += '<PARAM NAME=quality VALUE=best>';
flashMenu += '<EMBED src="flashUI/fl_header.swf?imgName=fl_image4.swf" loop=false quality=best menu=false bgcolor=#FFFFFF WIDTH="780" HEIGHT="214" NAME="fl_header" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" swliveconnect=true><\/EMBED>';
flashMenu += '<\/OBJECT><\/td><\/tr><\/table>';

my variable htmlMenu looks like this:

htmlMenu = '<table cellpadding="0" cellspacing="0" border="0"><tr><td background="images/header_pic4.jpg" height="214" width="780" align="right" valign="top"><table cellpadding="0" cellspacing="0" border="0" width="481"><tr><td height="7" width="481" colspan="6">images/spacer.gif<\/td><\/tr><tr><td height="16" width="98"><a href="about_us.asp" onMouseOver="switchImage(\'btnAboutUs\',\'images/btn_aboutUs_over.gif\');" onMouseOut="switchImage(\'btnAboutUs\',\'images/btn_aboutUs.gif\');">images/btn_AboutUs.gif<\/a><\/td><td height="16" width="94"><a href="products.asp" onMouseOver="switchImage(\'btnProducts\',\'images/btn_products_over.gif\');" onMouseOut="switchImage(\'btnProducts\',\'images/btn_products.gif\');">images/btn_Products.gif<\/a><\/td><td height="16" width="94"><a href="portfolio.asp" onMouseOver="switchImage(\'btnPortfolio\',\'images/btn_portfolio_over.gif\');" onMouseOut="switchImage(\'btnPortfolio\',\'images/btn_portfolio.gif\');">images/btn_Portfolio.gif<\/a><\/td><td height="16" width="94"><a href="news.asp" onMouseOver="switchImage(\'btnNews\',\'images/btn_news_over.gif\');" onMouseOut="switchImage(\'btnNews\',\'images/btn_news.gif\');">images/btn_News.gif<\/a><\/td><td height="16" width="94"><a href="contact_us.asp" onMouseOver="switchImage(\'btnContact\',\'images/btn_contact_over.gif\');" onMouseOut="switchImage(\'btnContact\',\'images/btn_contact.gif\');">images/btn_Contact.gif<\/a><\/td><td height="16" width="6">images/spacer.gif<\/td><\/tr><\/table><\/td><\/tr><\/table>';

those are rather complex...but I think you get the point

To see this implementation .... view the source on http://www.canusa.net

hope this helps some
turtlwaX

percepts
08-12-2004, 02:03 PM
the <embed> tag has never been and never will be part of the w3c html standards. It has no place in an html or xhtml document. Moreover you don't need it and have never needed it. What you do need is an understanding of how to implement the <object> tag according to standards.

below is an example:

<object data="yourflashfile.swf" id="yourflashfile" type="application/x-shockwave-flash" width="400" height="200" align="">
<param name="movie" value="yourflashfile.swf" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="best" />
<param name="scale" value="noscale" />
<param name="wmode" value="opaque" />
<param name="devicefont" value="false" />
</object>

the classid attribute is not necessary.
The embed tag is a big No No.

The data attribute is necessary for IE.

The above code will work on almost any browser that is standards compliant and validate in HTML 4.0 and XHTML (remove the "space /" at the end of <param> tags for html 4.0 )

The above code will not work on some older Mac operating systems using IE. It does work on Safari on MAC OSX

However, what you need to consider is that the non microsoft community have been whinning about microsoft not being standards compliant for years. Well now its time to tell the non microsoft community that if there software is not standards compliant then they better upgrade it otherwise it won't work with standards compliant web sites. So there.

What about the codebase parameter? Only a fool would allow their browser to automatically install an activex module from the web so code your own prompt for your users to allow them to make a choice rather some unhelpful message such as "your browser doesn't allow activex documents to run - this page may not display properly"

see http://www.g4dgardens.co.uk for a simple implementation of this.

greeneagle
08-17-2004, 06:25 AM
You can also imbed as an object, ie:

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

When doing it this way streaming in IE goes away. Complete file has to be downloaded. swf size must be reasonable. If concerned about validation though, you are probably following good SE practices and hybridizing the Site between 4.01/swf, if so hopefull the file sizes are small enough.

Obviously this is a stronger consideration for different audiences, considering access speed.

see: www.tubeltechnologies.com for example (validated page)

Ken

poab
08-17-2004, 07:07 AM
percepts as I've pointed out elsewhere, your markup does not work on several browsers, including old versions of IE for mac.

percepts
08-18-2004, 02:06 PM
How far back into the mists of html, browser and standards evolution do you think I should make my site compatible? Who decides where backward compatibility cut off point should be?
Should I tell my client that the site should be non standards compliant and that when the emebed tag is deprecated he will have to pay to have his site fixed or should I tell him I have made his site standards compliant and that it will be several browser generations before it needs to be fixed?

In my view minority groups using old non standard browsers should upgrade their browsers. There are plenty of free browsers out there which work just fine without the embed tag. Pandering to the minority groups just puts development costs up for your clients, requires more testing and is a pain. Just think how many millions of man hours have been wasted just trying to make web sites compatible with all the DOM, HTML and javscript implementations out there. The point of introducing standards is to stop that waste and make everyones life easier.
If that meens a few people who won't upgrade their systems don't get to see my website then so be it.

poab
08-19-2004, 09:10 AM
Actually I was refering to IE5.1 -- Given that it's not possible to upgrade Mac IE beyond this point without upgrading MacOs9 to MacOsX what would you have users do? Upgrade their operating system to view your site?


If that meens a few people who won't upgrade their systems don't get to see my website then so be it.
A fair point...I guess if you're only interested in users that share your set-up then fair enough.

percepts
08-19-2004, 09:29 AM
That's their choice. I'm not going to dictate to anyone what they should be doing just like I expect them not to try and dictate to me how I should write my website.

voodooboy
08-19-2004, 12:06 PM
"percepts" has an excellent point. The buzz word in all major Internet/technology arenas these days, such as the Digital Design World Conference, is "Forward Compatibility". It is time that we stop looking backwards and start looking to where technology is taking us. If you are not validating and designing to current and future standards (which yes, effects older browsers) then you are going to have difficulty being viewed in applications such as cellphones, PDA's and Pocket PC's.

If you don't start developing for the future technologies, then the people that are capable of paying for your services are not going to be able to see your offerings because you are stuck designing for the past. Your content will not be viewable in the new browser formats and access technologies.

The old saying, "Boy's and there Toy's" is true in technology as well. The companies that are buying, the people with the money, are eating up the new technologies like Wi-Fi Pocket PC's and PDA's. And if you are not in compliance, your message is lost to those that are not savvy enough to keep current.

Technology is going to continue to evolve, and it is not going to wait for you or anyone else to catch up. If you are not developing for future standards by the end of the year, you should seriously consider a new career.

poab
08-19-2004, 12:18 PM
The companies that are buying, the people with the money, are eating up the new technologies
Nope, the companies with the money expect a site that works -- give them anything less and you're not getting paid.

percepts
08-19-2004, 12:39 PM
poab:

The standards are designed to be cross platform. i.e. they are not platform or set-up dependant.

You see to be implying that the standards are pointless.

Can you please clarify your take on this. i.e. Do you think that web sites don't need to be written to conform to w3c standards.

Of course if you don't think we should adhere to w3c standards then you are condoning microsoft going their own merry way regardless of what anyone else is doing.

I wonder how you are going to resolve this question...

percepts

poab
08-19-2004, 01:14 PM
The standards are designed to be cross platform. i.e. they are not platform or set-up dependant.
I disagree with the second half of your statement -- standards are designed to be cross-platform and cross-browser, their implementation however is another matter.


You see to be implying that the standards are pointless.
Nope, sorry if I gave that impression. Not sure where I implied that.


Can you please clarify your take on this. i.e. Do you think that web sites don't need to be written to conform to w3c standards.
I'd prefer it if they were but actually, no they don't. You can write a website using html v1. and it'll still work in almost any browser because it's in the browser manufacturers interest to display as many sites as possible. At this point in time, there's no necessity involved.


Of course if you don't think we should adhere to w3c standards then you are condoning microsoft going their own merry way regardless of what anyone else is doing.
They do that anyway.


I think that with personal sites, and pretty much anything we can get away with, it's important to be as up to date as possible because it forces companies like microsoft to move ina coherent direction. However when building a corporate site for a client I think it's unreasonable to expect that client to accept losing potential clients, especially when they don't need to. From a business point of view, that's dangerous teritory.

percepts
08-19-2004, 05:37 PM
Nice try but dumping standards when it suits makes standards worthless since there will always be users who are a couple of generations behind the game thereby implying web sites will always be a couple of generations behind the game according to your approach.

I checked on one of my sites and approx 0.75% of visits are on mac with IE <= 5.1.7. Your mileage may vary but those 0.75% will probably be down 0.25% within 12 months. That would be 1 in 400 users who have a problem because I have no embed tag in my site. Out of that 0.25% I would estimate that 5% might be visits that would generate a genuine enquiry so that means 0.0125% of visits are actually lost to my client. i.e. 1 in 8000. My client can live with that. Your clients must be real picky.

I wonder how long it will be before the search engines and directories just drop any web sites not coded in xml cos thats the way its heading.

percepts

poab
08-20-2004, 06:58 AM
I stand corrected -- It doesn't work on IE5.2 on MacOsX either, which is the most up-to date browser Microsoft produces for a mac. It's not as good as Safari, but many people are using it purely for a sense of continuity after upgrading. As I said, it's not a question of standards, it's a question of the standards' implementation.


Nice try but dumping standards when it suits makes standards worthless
It's not about dumping standards, it's about developing for the real world instead of developing in a highly theoretical void.

In any situation, where standards are an ideal, that the reality cannot live up to, then the standard is worthless except in providing a bench mark to aim for.


I wonder how long it will be before the search engines and directories just drop any web sites not coded in xml cos thats the way its heading
When it's financially beneficial to do so. I'd guess it'll be a slow and gradual process in which deprecated standards that clash with current ones are dropped. I'd bet on around 5 years as a minimum.


BTW obuwebco sorry if this seems to have gone off topic for you, I don't think we intended to hijack the thread. Did you find the solution you were looking for yet?

obuwebco
08-23-2004, 03:28 PM
Yea i sure did.. here is the solution.. it has one drawback in that it will not stream files in ie for Win, So a large flash file will load fully before playing.. good/or bad depending on how u look at it.

But fully validates :)

<object type="application/x-shockwave-flash" data="images/newsletter_sign-up.swf" width="212" height="82">

<param name="movie" value="images/newsletter_sign-up.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
</object>

slideri812
12-20-2004, 06:27 PM
I know this thread is a few months old now but the topic is still being hotly debated. I have to agree with Percepts take on things.

The hot topic is forward compatibility; making sure the products and services being created and delivered today and tomorrow will continue to function as the tech advances through a few generations.

We are standing on a wobble board of sorts, how backward compatible to make a site on the one hand, and how far into the future to develop today’s product on the other. Old standards and old browsers are falling off like yesterdays snow in the summer sun. As a MAC user I am well aware that MS no longer supports IE. But with so many FREE choices available (can you say Firefox) there is no reason to continue with a non-compliant browser like IE 4.x or 5.x. FYI there is FF for OS 8

The future of design and programming is here, now, right now, so design for it.

My clients don’t give two rips about the person using OS 8. That user is not in the target demographic. Not to mention that some 90%+ of MAC users have updated into OS X.?. Way way more than the conversion rate of PC users moving from 9x into Xpee.

So if your butt is not on the CSS and XML/XHTML bus soon your concerns will not only be a mute point, they will quite literally be history.

slideri812
12-20-2004, 06:56 PM
poab,

BTW that article worked great. I have been working with this issue for a few weeks but that article has cleared the way.

greeneagle
01-07-2005, 10:00 AM
Here is what W3C recommends:
http://www.w3schools.com/flash/flash_inhtml.asp
Ken

paulhiles
01-07-2005, 10:33 AM
Hi Ken, I wasn't aware that W3Schools was published by the W3C, are you sure? Whoever is responsible for their content, it's certainly a reliable resource!

I recently went the "Flash Satay" route to validate Flash in a client's site, and I was mightily impressed with the results. Minimal code and no impact on the Flash performance.

For anyone who's interested, the site address is www.sylviapitcherphotos.com

Paul

slideri812
01-07-2005, 11:51 AM
Hi,

Paulhiles, that is a nice and to the point site. Nice sublte use of flash too, not to flashy LOL.

Thanx for the additional resources Greeneagle.

I have validated the flash on our our own site like this (according to the article):

<td><object type="application/x-shockwave-flash" data="movies/dcvi%20header.swf"
width="780" height="80">
<param name="movie" value="movies/dcvi%20header.swf" >
<param name="quality" value="high" >
</object></td>

When you use the insert flash tool in Dreamweaver it loads the additional code that causes the valadation to fail such as the ID and embed covered in the afore mentioned article.

Doing it the above way also makes it more straight forward for myslef. And I can still preview the object in the editor.

Thanx again for the help!

greeneagle
01-07-2005, 12:44 PM
You are right paul, I meant to say W3C Schools and left the "Schools" off.

Are these methods viewing in FireFox alright for you guys?

Ken

paulhiles
01-07-2005, 12:47 PM
Are these methods viewing in FireFox alright for you guys?
Funny you should say that! On the TubeL site, I'm seeing a white area in the header and right-hand side.

Paul

slideri812
01-07-2005, 06:54 PM
paulhiles wrote:
Funny you should say that! On the TubeL site, I'm seeing a white area in the header and right-hand side.

Ditto that. Also, I use FF exclusive for my browsing. I use IE to tweak my sites for the client. Its still gotta please the masses.

I do have one issue with FF, when I log into my server as a client to set up email or something I get booted out and am prompted for my UN and PW then it just cycles. I was told it was because I had cookies off but that was not true. So I'm still looking for an answer.[/b][/quote]

greeneagle
01-11-2005, 11:50 AM
Well guys, guess that Was the reason I was asking - Hoped one of you might offer a code tweak that fixes that detail.

Ken

paulhiles
01-11-2005, 03:06 PM
There seem to be two options for embedding Flash movies into XHTML and remaining both valid and visible!

1) The Flash Satay method featured at A List Apart

2) Using JavaScript to create <object> and <embed> tags.

Read more (http://blog.deconcept.com/2004/10/14/web-standards-compliant-javascript-flash-detect-and-embed/)

Although saying that, I've just tried a slightly different method which seems to work in both IE and Firefox.


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


You need the Flash plugin.</p>


Download Macromedia Flash Player (http://www.macromedia.com/go/getflashplayer/)</p>
</object>
You can see it working here (http://www.sylviapitcherphotos.com/slideshow.html). Hope that helps!

Paul

paulhiles
01-11-2005, 04:29 PM
Also Ken, you're using the filename "movie.swf" in your object's data attribute. If you replace this with the actual shockwave/Flash movie name ("header.swf") you should see an improvement!

So for example, the Flash in your page header should look something like the code below:

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

greeneagle
01-12-2005, 05:51 AM
Thanks Paul,

That was my first attempt some time ago, guess I "hosed" that one.

I hadn't seen the javascript method before... good references.

This will be a continuing issue, I hope W3C makes some ammendments to accomodate Flash better as there is no perfect solution for what customers demand there.

I'll get back to it as soon as I can, but you can bet I'll approach a PR6 that defies all current GOOGLE logic with 4-5 OBLs and virtually "0" IBLs carefully since I don't understand it!

It just went from 4s and 3s throughout to 6s and 5s throughout, and for the life of me, using any current thinking on GOOGLE algs... I don't know why!

Ken

greeneagle
01-24-2005, 10:00 PM
Thanks Paul,
Got it worked out!
Ken

poab
01-31-2005, 09:29 AM
W3C makes some ammendments to accomodate Flash W3C recommends SVG not flash and is unlikely to ever validate the latter.

...and I'm really surprised this thread is still going!