Flash getURL clickthrough workaround for MySpace

3 12 2007

Found a way to get around the fact that you can’t use getURL to do clickthroughs from Flash embedded in MySpace. (They banned using getURL due to last years Flash injected XSS “Samy is my friend” worm crippling many a benign Flash app)

The way round it is to position images in the places where you want the clickthroughs. Now this sounds easy but there’s no documentation, you can’t use DHTML layers or JS or full CSS layouts (have to use tables), theres a million CSS bits you have to override and the editor does a search and replace on certain strings when you save the tag in MySpace and sometimes treats whitespace as line breaks – very frustrating!

Finally nailed it – the London Marathon Countdown Widget app I built is hosted on my MySpace http://www.myspace.com/lordrobertmc, clicks through ok and is tested in IE7, Firefox & Safari. Here’s the code if you’d like to benefit from my painful experience ;)

N.B I also discovered that you can’t use FlashVars to embed variables only ? querystring. Bah

Here’s what your widget will look like:

Here’s the code:

<style type=”text/css”> table.adiflmw { width: 396px; height: 250px; border-width: 0px 0px 0px 0px; border-spacing: 0px; border-style: none none none none; border-color: white white white white; background-color: white; } table.adiflmw td { border-width: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border-style: none none none none; border-color: white white white white; background-color: white; -moz-border-radius: 0px 0px 0px 0px; } a:link, a:active, a:visited { color:#ffffff; } </style> <table class=”adiflmw”> <tr> <td valign=”top” align=”left”> <span> <a href=”http://adidaswidgets.glueserv.co.uk/v9/” id=”adiCt1″><img src=”http://adidaswidgets.glueserv.co.uk/v9/adiflm396x38.jpg” border = “none” /></a><br><object type=”application/x-shockwave-flash” allowScriptAccess=”never” allowNetworking=”internal” height=”130 name=” width=”396″ align=”middle” data=”http://adidaswidgets.glueserv.co.uk/v9/Clock02.swf?spURL=http://www.justgiving.com/gorillarob&getCountDownLink=http://adidaswidgets.glueserv.co.uk/v9/”> <param name=”allowScriptAccess” value=”never” /> <param name=”allowNetworking” value=”internal” /> <param name=”movie” value=”http://adidaswidgets.glueserv.co.uk/v9/Clock02.swf?spURL=http://www.justgiving.com/gorillarob&getCountDownLink=http://adidaswidgets.glueserv.co.uk/v9/” /> <param name=”quality” value=”high” /> <param name=”wmode” value=”opaque” /> <param name=”bgcolor” value=”#ffffff” /> </object> <br> <a href=”http://www.justgiving.com/gorillarob” id=”adiCt2″><img src=”http://adidaswidgets.glueserv.co.uk/v9/adiflm396x82.jpg” border = “none” /></a> </span> </td> </tr> </table>

N.B You’ll have to manually swap those curly brackets for standard double quotes as Code Snippet doesn’t like this block for some reason :(

If this helps you in any way please distribute this link via any of the provided Bookmarking tools; thanks!

Enjoy ;)


Actions

Informations

3 responses to “Flash getURL clickthrough workaround for MySpace”

10 12 2007
Wyatt (23:57:53) :

Hi, I tried this with CodeSnippet and it looks like it works. It seems the GeSHi highlighter doesn’t like the non-standard HTML characters in the HTML:
[code lang="html"]

table.adiflmw { width: 396px; height: 250px; border-width: 0px 0px 0px 0px; border-spacing: 0px; border-style: none none none none; border-color: white white white white; background-color: white; }
table.adiflmw td { border-width: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border-style: none none none none; border-color: white white white white; background-color: white; -moz-border-radius: 0px 0px 0px 0px; }
a:link, a:active, a:visited { color:#ffffff; }

[/code]

Though … that might break the src tags. I’ll drop a note with the GeSHi folks.

12 12 2007
Rob (08:03:17) :

Will give that a test when I get a mo. Thanks!

1 02 2008
Ade (07:56:55) :

Cunning. And I’d thought they’d just blocked it to try to stop people from clicking off their wonderful website! I’ll have to give it a whirl in my Flashteroids Widget.

..aAdds Rob’s Geeky Discoveries Blog to his list of geeky blogs

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>