Tuesday, March 17, 2009

How To: improve a flash template file

For those of you using Atlas, or other systems that allow you change the template file that a flash ad uses - consider the below points and whether they are in your current template, and whether you should change to make a more robust functioning template.

1st check: Are you using flashvars?

long ago flash templates would pass variables to the flash file in the query string. The problem with this method is that the URL may become too long and the browser may drop some information. Try using flashvars to pass things like your clickTag < http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417 >

2nd check: Are you escaping ampersands in the click URL?

make sure you are escaping the ampersand before putting it in to the flashvar string. New ampersands tell the script that it is a new variable being passed. You may like to experiment with only escaping the query string, or just replacing all ampersands with %26 using a .replace() function.

3rd check: Is wmode set?

wmode should always be set - and usually to opaque. This will prevent problems with dhtml menus and other flash files when they are over the top of one another

4th check: how does the backup work?

Have a look where the script and no script blocks are. I have seen a couple of sniffers where if flash wasn't installed and javascript was, it would show the backup twice.

5th check: Secure calls?

If you have secure sites - consider checking the document.location for https, and if present, update all other calls on the page to use https in the code.

6th check: Eolas issue

This should no longer be a consideration for updated browsers, do you need to keep that external javascript call to allow for it?

***UPDATE***

There is another enhancement that I neglected to mention as it is for the preview screen rather than the live template. If you use the same template for previewing a flash ad as the live one then you can put a check in for the document.location before running the below.

Make your background red - this is great for checking that a flash ad has put in it's background correctly and that wmode is setting it to opaque. you can do this with the simple document.bgColor="red";

No comments: