2
votes

Is there any way I can secure my own flash game's source code? Or even find a tricky way to hide it.. I was thinking of using something like this : Put all my functions in an .as file in a folder like source/abasd/asdfas/code.as, and then import it from the game

  import source.*;

Would this actually work and people wouldn't see my code? Or there is no way of hiding it..

2

2 Answers

2
votes

You do not publish source as is, it's retrieved via Flash de-compilers. The best way you can reliably employ (which won't provide total protection anyway) is run an obfuscator against your SWF or source set. This way the SWF will be filled with lots of garbage which wouldn't break its normal work but will stand in the way of the hacker that'll try to retrieve the actual instruction set.

0
votes

A fast way to obfuscate your code is to embed the swf in another. No method is perfect but the idea is to make it harder so only some rare decompilers will be able to see anything.

[Embed(source="scene1.swf", symbol="scene1ID")]
private const SCENE1:Class;

private var scene1:MovieClip = new SCENE1() as MovieClip;
scene1.play();