Get the full commented source code of

HTML5 Suika Watermelon Game

Talking about Actionscript 2, Actionscript 3, Flash and Reviews.

« I’ve just found a site that won a top international online advertising award – and it’s been blatantly lifted from me!

Its a flash application that has the same vectors and almost certainly the same AS code. Is there anything I can do? I’m in the UK – they’re in Brazil. »

The guy who opened this thread looks quite desperate… now imagine this happening to your latest Flash game.

That’s why you must protect your code. You don’t want someone else stealing your work.

I am going to review DCOM Soft‘s SWF Protector.

SWF Protector

SWF Protector is an swf protector software working through actionscript encryption to secure your actionscript content. This means decompilers won’t be able to read your actionscript.

The most interesting SWF Protector features are:

* Inexpensive: only $59.95 for a Business License. You can earn twice in just one day with a single game.

* Simple and fast. You can encrypt your SWF with a couple of clicks.

* Cross-platform. Available for Windows, Mac and Linux.

* Mass protection. You can protect several SWFs at once.

This is the interface you’ll see when you are about to secure your flash content:

I am testing the software on the file created on Box2D Flash game creation tutorial – part 2 tutorial.

This is the original content of the custom_contact_listener.as file:

package {
	import Box2D.Dynamics.*;
	import Box2D.Collision.*;
	import Box2D.Collision.Shapes.*;
	import Box2D.Dynamics.Joints.*;
	import Box2D.Dynamics.Contacts.*;
	import Box2D.Common.*;
	import Box2D.Common.Math.*;
	class custom_contact_listener extends b2ContactListener {
		override public function BeginContact(contact:b2Contact):void {
			// getting the fixtures that collided
			var fixtureA:b2Fixture=contact.GetFixtureA();
			var fixtureB:b2Fixture=contact.GetFixtureB();
			// if the fixture is a sensor, mark the parent body to be removed
			if (fixtureB.IsSensor()) {
				fixtureB.GetBody().SetUserData("remove");
			}
			if (fixtureA.IsSensor()) {
				fixtureA.GetBody().SetUserData("remove");
			}
		}
	}
}

Now, I will use a Flash decompiler to extract the same file from an unprotected version of the swf… here it is:

//class custom_contact_listener
package 
{
    import Box2D.Dynamics.*;
    import Box2D.Dynamics.Contacts.*;
    
    internal class custom_contact_listener extends Box2D.Dynamics.b2ContactListener
    {
        public function custom_contact_listener()
        {
            super();
            return;
        }

        public override function BeginContact(arg1:Box2D.Dynamics.Contacts.b2Contact):void
        {
            var loc1:*=arg1.GetFixtureA();
            var loc2:*=arg1.GetFixtureB();
            if (loc2.IsSensor()) 
            {
                loc2.GetBody().SetUserData("remove");
            }
            if (loc1.IsSensor()) 
            {
                loc1.GetBody().SetUserData("remove");
            }
            return;
        }
    }
}

The code is amost more polished… and obviously it works.

Now let’s try to do the same on the obfuscated swf made by SWF Protector… that’s what I got (sorry for the italian screenshot: I’m currently running an italian version of Windows7)

The decompiler crashed… probably the amount of weird characters inserted by the flash obfuscator made it crash.

In the end, SWF Protector is simple to use and very fast. It has shown lightning-fast speeds of SWF files loading, processing and saving and uses four reliable protection algorithms.

You can download a trial version on the official site or win one of three business licenses I am giving away being the first to reply “I want one” when this post will be published on my Facebook Fanpage. This is a special giveaway for three of my Facebook fans. And won’t be the only one.

Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.