Discover & Rate New Music Check out ChartVote. Promote the music you like.


MySpace Flash Workaround Hack

Last year MySpace was attacked by a flash based worm which caused MySpace to disable links from flash including getURL by appending the following properties to your object tag:

HTML:
  1. <param name="allownetworking" value="internal" />
  2. <param name="allowScriptAccess" value="never" />
  3. <param name="enableJSURL" value="false" />
  4. <param name="enableHREF" value="false" />

Yeah now that sucks. You say: "What do I do now? My cool flash widget I've spent so much time working on doesn't work properly in MySpace! Ahhh!!"

Enter the Hack
Now this isn't pretty and I don't like having to do this at all, but it works. The solution is to add a relatively positioned div that hovers on top of your flash with a transparent gif thats linked to the page you originally wanted to link to from your flash.

Example Code

HTML:
  1. <embed src="http://www.yourflashmovie.com/file.swf" width="221" height="334" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
  2. <div style="width: 90px; position: relative; top: -38px; left: 65px;">
  3. <a href="http://www.whatyouwanttolinkto.com"><img src="http://www.domain.com/blank.gif" border="0" width="100" height="20"></a>
  4. </div>

Just set the size of the GIF to the size of the region you want to be linkable and position the div correctly over that region and voila...you have a MySpace flash workaround hack.

I've tested this in Firefox 2 and IE 7. Anyone care to test this in Safari 2?


21 Comments

  1. BrainFuel » Chris’ Weekend Links - March 3rd on March 3rd, 2007

    [...] Flash Workaround Hack for MySpace. [...]

  2. paublito on March 13th, 2007

    Bless you kind hero. . .

  3. Michael Fleet on March 20th, 2007

    Works nicely in Safari 2.0.4. :)

    Thanks!!

  4. steelie on March 28th, 2007

    I did the new code and myspace now puts their code in there... am I doing something wrong?

  5. Acid on March 31st, 2007

    still u cannot do a getURL(); and becuase of that i still canno call call javascript:Blahblah, becuase if the word javascript is used in the profile it is censored....GRRR....oh well its a work around...not a solution..i gues i m askinfor too much...thanx a bunch tho

  6. Kevin on April 21st, 2007

    i have gotten getURL() to work in my flash files in myspace. found a beautiful little hack and its still working as of 4/21/2007. hell, havent found anything that i cant use in flash. well "javascript:" in there requires u to change security setting in the flash 9 plugin and thats a per client setting thats turned off by default

    I dont want to give it away yet, cuz i know it will get filtered out like all the other hacks, like the flashvars one was a while ago. i know someone will try and exploit it as well.

  7. me on May 3rd, 2007

    Hey Kevin.
    Does your hack still work? Please, please, please, give me. I'll keep it top secret. My page needs u. Send a message 2 myspace.com/arkworlduk if u can.

  8. Kevin on May 7th, 2007

    They just fixed it today. or the fixed it a within the last couple days. it relied on using the myspace redirecter page and redirecting it to your off-site flash file. the beauty of this was that it allowed allownetworking to = all. but i am working on a way to get it back working. gonna find a way. this will be the 3rd time one of my hacks gets shut down.

  9. Kevin on May 7th, 2007

    ok i figured out another way around it. one hint: percent-encoding. this will be hard for them to filter out, there would be so many combinations for them to filter. i think this may work out. hehe with a little persistence, the myspace nazis will not get me down.

  10. eth0 on May 12th, 2007

    Kevin, care to share? ;)

  11. Character x on May 30th, 2007

    I did some thing different but only works in IE I need it to work in Firefox. take a look myspace.com/character_x . I just made the background in flash transparent and put the links under a div tag under the flash movie to make it work, but this only works as I said in IE.

  12. Kevisazombie on June 26th, 2007

    How can I get this to work in multiple spots. I have 3 buttons that link off site via getURL and need them all covered. I've made individual style classes for each div and set the positions. this works ok in Firefox but does not line them up in IE.

  13. Josh on August 23rd, 2007

    Haha, I had this problem a while ago on my first flash page. Orginally I thought of just putting the hyperlink around the empty DIV (horrible I know...) which actually works in FF but not IE. I had a look around and found out about the invisible GIFs and sorted it all.

    ANYWAY, my little query is, surely it won't work for people using a different text size on their browser? The DIVs will be too high/low?

  14. Cathy on September 3rd, 2007

    Tried the solution above, but the div with the gif in sits under the flash and not above, any ideas?

  15. LaLa on September 10th, 2007

    You need to set your z-index to a higher layer than the flash file.
    if your flash file is z-index:1 then your gif div needs to be at z-index:2
    All that should be in your css

  16. menno on September 10th, 2007

    I used this fix to add Flash buttons created with http://www.amarasoftware.com and it works great

  17. Gianni on October 19th, 2007

    Anyone know how to detect from ActionScript whether getURL is available or not??

    I believe youtube does it somehow, they know whether they can link to the video on youtube.com, or display a link that you copy and paste. I'm looking for the same behavior..

  18. honkykong on February 29th, 2008

    ... just target '_blank', no need for all this other hacky nonsense

    http://kb.adobe.com/selfservice/viewContent.do?externalId=50c1cf38&sliceId=2

    "if you do not control the content of the HTML page that hosts the SWF file, you can change your getURL or navigateToURL call to use "_blank" as the target, which will cause your getURL (or navigateToURL ) operation to open your URL in a new browser window. This will work in Flash Player 9 regardless of the value of AllowScriptAccess."

    tested this just now and confirmed that it does work from myspace even with the allowscriptaccess restrictions.

    btw: thank you for publishing your fix, an innovative solution... but it seems there is an easier way.

  19. Cardigan Carl on April 3rd, 2008

    Honkykong, it's not allowscriptaccess which limits the getURL function at all (it merely just restricts javascript and server side scripting), it's the allowNetworking param and "_blank" is of no consequence to this action whatsoever as it incorporates the security restrictions of both params on some gestapo shi... So no, you didn't test this just then (even in Feb) because that's never worked nor will it ever work. The only workaround on this page (aside from the clear gif crappiness) is what Kevin was using, which has long since been filtered out now due to it's overuse of spammers. They didn't filter his creative use of ascii characters but they did then implement msplinks (which has it's own unrelated workaround - but that's another blog) thus reinventing the entire redirection process anyway. He's still along the right lines though. The only way to beat the embedding filter is to trick the filter into believing it's myspace media that you're embedding. If somebody figures out a way to call a myspace player url and then your own immediately after without breaking the string, then by all means, speak on it. I'm all ears. Until then... clear schmifs.

  20. Jamie Michels on April 15th, 2008

    If you absolutely have to use outgoing links via Flash in MySpace, I devised a pretty clean workaround. My MySpace page features a customized Flash news system which enables users to read my current news via XML. At the bottom of each article, there is a button that when clicked provides an external link regarding the corresponding article. You're probably wondering how the hell I was able to achieve this on MySpace, but it's rather simple! Once the button is clicked, the link is automatically copied to the Windows Clipboard and then all the user has to do is paste the link in their browser window! Since they would most likely be unfamilar with this type of procedure, it would probably be in your best interest to place a tooltip over the button onRollOver instructing them to click the button and then paste the new link in their browser window. To see my working example, please visit: http://www.myspace.com/jamiemichels

  21. David Simms on May 21st, 2008

    This is a pretty good workaround. The only problem I see is that it negates any rollover or click animations that you may have programmed into your SWF file.

    I created an SWF file for my Myspace page with multiple buttons on it. The buttons are very dark until you hover your mouse over them. Once you do, the buttons become very bright. When you click them, they blink.

    Having the transparent GIF on top of them, stops this animation from happening. Is there any way around that?

Leave a Reply

RSS Feed



Recommended Sites