Personal and Professional Blog of Rich Hauck

Sharing SWFAddress links with Facebook

November 17, 2010

Just discovered that Facebook’s link-sharing API doesn’t like links that aren’t URL encoded. This means that in cases where SWFAddress is used you’ll get funky results due to the necessary hashtag (#).

The solution is to use encodeURIComponent(), which can be found in Javascript, and conveniently as a top-level function in Actionscript 3.

So links can be shared in Actionscript via:

var url:String = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent("http://www.mysite.com/#/whateva");
var request:URLRequest = new URLRequest(url);

UPDATE: Actually, it wasn’t very friendly with this, either, so I ended up using bit.ly’s API to shortcode the URL before passing it to Facebook.

Finally Got One

November 4, 2010

I’d have never expected a line of over 1,000 people for Strasburg bobblehead night at the Senators Ballpark in Harrisburg. I guess I’m not crazy enough to show up a 7:00 am and wait 8 hours in line. Fortunately, a rather quiet promotion run by the Senators team store last Saturday netted me a free t-shirt and one of the remaining bobbleheads.

Obviously, Strasburg’s popularity has simmered down with his injury, and it wouldn’t be too surprising to see him play in Harrisburg again next season.

Categories: Harrisburg

About Me

Rich HauckI'm a designer, developer, and teacher based in Harrisburg, Pa. I run Hauck Interactive, Inc.




Archives