Infinite Pixel Studio Logo
Home
Corporate
News and Blog
Mobile Games Store
Contact Us
Infinite Pixel Studio Mini Logo
| Recent News | Our Projects | Game Reviews | General Dev Tips |

Is your Flash, not validating to W3C standards? - 01 August 2008

Maybe I can help, or at the least show an example of how I solved this Problem recently

My needs for my site are that my Mobile Game Flash Store would work in an Environment, meeting XHTML standards, specificially in my case XHTML 1.0 Transitional, and an UTF-8 encoding.
Validation done by W3C as per the Linked Images at the bottom of each Page.

The Primary Objective, is to get the Flash store to work, in the 3 major browsers I use for web development, Firefox, IE and Safari.
All which are the Latest versions, and tests have shown even reasonably older versions do work also.

The Secondary Objective, is to get it to update the users flash / browser, which if not possible, would simply link the users to where it could be updated outside of this code.

Lets focus on the Primary Objective (It‘s what I‘ve explained):

The Code below, is pretty much what I started with, Movaya code for their Game Store, robust and works with any browser, but doesn't fit my needs, so I went onto modify it so it did.


<OBJECT id="flash" name="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" 
WIDTH="600" HEIGHT="450">

<param NAME="movie"  VALUE="http://flash.movaya.com/client/600450.swf
?sId=IEvyUBrD64A%3D&acId=3&tgId=3&ibg=191919
&obg=262626&sb=999999&line=CCCCCC&words=FFFFFF&navigation=666666&priceTxt=8B8064&optw1=000000
&optw2=CC0000&optw3=0066CC&optw4=977735&btnbg=1B1B1B&btntxt=FFFFFF"  >
<param NAME=quality VALUE=high><param NAME=bgcolor VALUE=#FFFFFF> 

<EMBED name="mm" src="http://flash.movaya.com/client/600450.swf
?sId=IEvyUBrD64A%3D&acId=3&tgId=3&ibg=191919
&obg=262626&sb=999999&line=CCCCCC&words=FFFFFF&navigation=666666&priceTxt=8B8064&optw1=000000
&optw2=CC0000&optw3=0066CC&optw4=977735&btnbg=1B1B1B&btntxt=FFFFFF"
 
quality=high bgcolor=#FFFFFF WIDTH="600" HEIGHT="450" NAME="store2" ALIGN="" 
TYPE="application/x-shockwave-flash" allowScriptAccess="sameDomain" 
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ></EMBED>
</OBJECT>

As you know well this makes use of both the Object and Embed Tags. It essentially is passing the same flash file and set of parameters twice, to fit the needs of many browsers, in what is their native and preferred use of Flash is either

<object>

or

<Embed>

XHTML won't validate with Embed, also it doesn't like Capital letters for tag's names, and & and = symbols in code, so you have to use escapes, and a few others, but not so important right now.

First up I got removed the embed tags, and most of what was inside it, just keeping the important part that is in there

 type="application/x-shockwave-flash" 

The links to the Macromedia site to get the latest flashplayer are worth saving ("http://www.macromedia.com/go/getflashplayer").

I then changed all the tags into lower case, and you have this.


<object id="flash" name="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" 
width="600" height="450">

<param name="movie"  value="http://flash.movaya.com/client/600450.swf
?sId=IEvyUBrD64A%3D&acId=3&tgId=3&ibg=191919&obg=262626&sb=999999&line=CCCCCC
&words=FFFFFF&navigation=666666&priceTxt=8B8064&optw1=000000&optw2=CC0000
&optw3=0066CC&optw4=977735&btnbg=1B1B1B&btntxt=FFFFFF" >

<param name=quality value=high><param name=bgcolor value=#FFFFFF> 

type="application/x-shockwave-flash" 
</object>

Next up you need to insert that *type* tag and it's data, replacing the existing classid.
Remove the codebase tag and it's contents at the same time, replacing it with data tag, and it's contents being the same as the "value" in the first param tag.

Then replacing each time you see a "&" with (not with the " ")

&amp;

Then you have to make sure there is an "/" in any self closing tag, with a space between the name and the tag itself, like below, this goes for all self closing tags. The most common examples would be

<br/>

rather than

<br />

In this case though it's just the below we have to worry about;

<param /> 

In the end you end up with code that looks a little like the below.

This is actually what I have in my Mobile Games Store (Powered by Movaya)

Notice

If you like what I've done, and If i've helped you in anyway, and wish to use it, all I ask, is that you link to this Page, to credit me. Oh and Please none of this "nofollow" link stuff, I do realise the difference. Below is a suggested Link you can use, with the Code.



Infinite Pixel StudiosDeveloper Tips - Get your Broken Flash Validated

Other Examples

Many Big names, allow you to make use of flash, automated out, and it won't pass Validation because of a few reasons, some are using embed, some are using symbols that aren't escaped to be ok in the UTF-8 encoding.

When Youtube joined up with the Google, and made use of this to have YouTube Video Units as an adsense unit, that was a great step, and many Google ad users where happy to see this, since before many used individual Youtube boxes, but this made it so much easier, and had ads in it too, to make a little profit on the side.

Problems came about quiet soon
It is my opinion due to the fact it is so far impossible to validate it, even using these few tricks, it was clearly either badly programmed or purposefully made so it wouldn't pass a W3C Validation. I myself was one of these that had it on every page of my site, but upon finding that it's code was impossible to validate, I removed it, even though I loved it so much, and until they change it or I can find a way to alter it to work, I will not put it back.

Maybe 2 or 3 others have publically spoken out about it on their blogs, but I know many have sent feedback, but as of yet, still no change in the code.





We started in Mobile Games Industry, Stepped up by adding Facebook (Web Apps) to the Profile, and now are doing PC games (Latest in house Game engines). From Code suggestions from our varied work, To general news in and around the games industry.
Get Games Downloaded Directly to your phone, just visit our Games store, and view them there, browse for any you like. Game Backgrounds, Wallpapers and Applications are also available, they go straight to your phone Bill, and work on nearly any phone.

Copyright © 2007 - 2008 Infinite Pixel Studios Ltd. All Rights Reserved.

Infinite Pixel Studio Monster Logo

| Home | Corporate | News / Blog | Games Store | Contact Us | Site Map | Privacy Policy |

Valid XHTML 1.0 Transitional Valid CSS!