Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I understand correctly, the main point of protecting a single player flash game is to keep it sitelocked. How to do this right and are there any other reasons to do this?

share|improve this question
Wouldn't an iFrame circumvent sitelocking? I know it's an age old debate, but I believe, since people will steal your content anyhow, it might be better to embed advertising and at least get revenue from it. And if they steal it, at least they don't steal your bandwidth. Of course, the downside is that you can't post updates once it leaves your site. – Kaj Jul 27 '10 at 23:46

The best solution for site locking is to make sure the start of the url matches your allowed url:

if (stage.loaderInfo.url.indexOf("") == 0)
share|improve this answer
don't forget to check for no "www" and simetimes you might have to check for "https". You might have to also watch out for other subdomains. This is not a good solution in my opinion. – Adam Harte Sep 20 '10 at 20:27

Don't. People will steal your game, no matter what you do. Trying to sitelock a flash game smells of DRM to me (OK, it's not quite DRM, but it's pretty close), and you can read all about why DRM isn't going to work. That's not to say you shouldn't use any protection system at all, just not something that you have to visit their site a particular way and do the hokey pokey to play the game.

share|improve this answer
The best you can hope for is that you have ads or some other revenue model built in so that when your game does get stolen (as it will) that you'll still make some money from it. Trying to prevent the game from being stolen is not going to be productive at all. It's better to take advantage of it and allow the game to be stolen while still giving you benefits. – Dennis Munsie Jul 29 '10 at 13:43
@Dennis: i'm glad PC game indie devs don't take your advice ;) but yea i suppose that's good advice for flash. – RCIX Jul 29 '10 at 14:44
I've got no problem with ads as long as they are added in a meaningful way and unobtrusive way. – Noctrine Aug 2 '10 at 19:33
Depending on the size and popularity of the title, a sitelock could easily prevent all actual users from stealing it. Only if the game becomes very popular will this ~DRM be circumvented. – Nate Sep 20 '10 at 17:06

Sitelocking keeps honest sites honest, and is useful when, for example, you've got an exclusive period on a site but plan to distribute the game afterward. It's not going to stop someone dedicated enough, and I agree that it's better to put in MochiAds or something to take advantage of the distribution.

One case in which sitelocking is vital is when you are selling non-exclusive licenses after you've done a primary license. In that case, sitelocking ensures that the nonexclusively-branded version doesn't spread, since the sublicensing sponsor is paying less and you've already promised the primary sponsor all of the viral traffic. Yes, the sublicensor can circumvent it, but if you don't trust them, you shouldn't do business with them in the first place.

share|improve this answer

Buy an encoding software, so reverse engineering softwares won't work. They cost like 40-50 bucks and since game development is a long and tedious process, it really worth investing.


share|improve this answer
Encoding software creates an extra hurdle, but doesn't protect your game from reverse engineering. If the flash player can play it, it can be decompiled. – Andreas Aug 6 '10 at 6:53
Funny side note: Eltima's trillix can decompile dcomsoft's swf protector protected files. And dcomsoft and eltima "seem" to be the same company. – Andreas Aug 6 '10 at 6:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.