First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Alexandre Chevalier | Website: http://www.dcomsoft.com
Protect Flash:How to Protect SWF from Flash decompilers?

How to protect ActionScript code from Flash decompilers?

To protect ActionScript code inside your SWF files you can use SWF Protector by DComSoft.

Step 1.

Retrieve the installation package of SWF Protector from the official vendor`s website. Depending on OS type you use, download installation package for Windows, Mac OS X or Linux;

Step 2.

Install SWF Protector following installation steps;

Step 3.

After installation process is complete, launch SWF Protector;

Step 4.

Choose one of the available protection modes: Simple or Advanced.


When working in Simple mode, SWF Protector uses default protection algorithms, depending on the version of ActionScript in SWF file, both for standard and author scripts.

In case when SWF file contains AS 2.0, "Mask script" and "Mix script" algorithms are applied.
"Mask script" is an effective method to conceal code and doesn't lead to file size increase.
"Mix script" mixes the source code. This method is rather effective, but leads to file size increase. That is why SWF Protector offers an option to set the intensity of this method. In Simple mode the intensity for AS 2.0 files is 50% by default.

For SWF files with AS 3.0 "Protect" and "Obfuscate" algorithms are used.
"Protect" method modifies the scripts in such way that SWF files can play in Flash player, but cannot be decompiled.
"Obfuscate" method renames variables and other objects. It doesn't protect file from decompilation, but makes the code impossible to use for further compilation.

Simple mode use in SWF Protector - reliable ActionScript obfuscator
Imgage 1 - Simple mode use in SWF Protector - reliable ActionScript obfuscator

When using "Mix script" you can leave the default intensity value which is 50% or choose other using the slider. Note, that the lesser the intensity, the lesser the file size; however the protection security level is lower in this case.
Note 1: If "Mix script" is set to minimum, this protection method won't be applied.
Note 2: In order to decrease the resulting file size it is recommended not to use "Mix script" and methods for standard code. In this case however, the protection will be less reliable.
» Level Advanced

Added: 2010-04-01
Rating: 7.75 Votes: 4
» Author
DComSoft evangelist SWF Protector 2.0
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.