Skip to navigation

malevolent design weblog

This blog is now defunct, but you can find more stuff over at my personal site

Posting Scores To Twitter From Flash Games

It’s great to give games things like high score tables and social networking integration, but there isn’t always time for server-side coding or working out how to hook into a third-party service. Here’s a really simple feature that can help players to publicly share their scores and thereby promote the game.

Twitter allows the contents of a tweet to be prepared by putting it on the end of

The user has to be logged in and click the ‘Tweet’ button to post it, but there’s no authentication/API faff, just a simple URL.

So when someone plays a game and is presented with their score, you can show a ‘Post to Twitter’/‘Challenge Friends On Twitter’ button that when clicked does something like

// ActionScript 2
	escape('played '+gameTitle+' '+shortUrl+' and scored '+score+' #'+hashTag),

// ActionScript 3
navigateToURL(new URLRequest(''+
	encodeURIComponent('played '+gameTitle+' '+shortUrl+' and scored '+score+' #'+hashTag)),

to generate a tweet along the lines of

played Captcha Invaders and scored 12345 #captchainvaders

Obviously it’s not a seamless experience, and the score can be freely edited, but it’s incredibly easy to implement and may encourage players to spread the word.


Comments are now closed for this entry.