In December-January I travelled to Sri Lanka. As always I was carrying way too much photo equipment with me, but the photo’s are well worth the effort.
Here are some of my top shots:

Sunrise on Adam's peak, Sri Lanka Tea plantation, Sri Lanka

Adam's peak, Sri Lanka dragonfly macro

IMG_7978_1 wasp macro

monkey monkey

Adam's peak, Sri Lanka sunset

The complete set can be viewed here.

Better late than never. Here’s my view on Flash On The Beach 2011:
Just like last year, and 2 years before that, I was present at Flash On The Beach. For those of you unfamiliar with this conference, it’s one of the best events for multimedia developers and creatives in Europe. Well at least that’s how I feel about it. Great atmosphere and venue, and quality speakers from around the world.
Everytime I go, I return with tons of fresh ideas.

Flash on the beach 2011

Here’s how my 3 days at the event looked like:

Day 1:
As always, the day started with the obligatory Adobe keynote. I expected the same boring info from them, but this year this “session” was somewhat more interesting. I think it was during this session I first picked up the news about Adobe developing a 2D  framework on top of Molehill/Stage 3D.
Years ago I used engines like Torque 2D to develop 2D games, and when I first heard about Molehill I was already hoping that something like that would be built upon the stage 3D API. At the time of the event, the name of this project was still a secret. Now it’s released to the public: the Starling framework. Can’t wait to to play with it!

After the keynote I went to see Greg Rewis’ session about mobile development. His session was named “from zero to app in 60 seconds”, but it only confirmed my perception that mobile development takes a lot of time to perfect, and I definitely do not want to use tools like dreamweaver to do it.
After that, John Howard. I expected more from this session, but overall it was a good. He reminded me of some things I used to do when I developed games, but I stopped doing because of budget and timing: user interaction tests and making sure your game can be controlled in more than one way (not only mouse or only by keyboard). I will keep this in the back of my head when I work on my next game.
I really wanted to see GMunk, but I promised myself to choose more sessions this year that would be of use in my daily work. So instead I went to see Rob Bateman’s session about Flash 11 3D capabilities. Luckily I was able to see some of GMunk’s work in the jam session on the 3rd day.
And then Eugene Zatepyakin. Oh boy. He is sometimes hard to follow but his sense of humour and his impressive work totally compensate this. He developed an image tracking framework. Even though he mostly ported code from other languages to actionscript, the speed optimisations he did are spectacular. Thumbs up!
During the evening session Jon Burgerman was talking. Very inspiring stuff, and such a great speaker. This session felt more like a performance than a speech. Check out his doodle-like artwork. I would sure love to have one of his works on my wall.

Day 2:
I started the second day with a presentation from the people of Wooga. They talked about how their team was organized, and gave some insight into their development methodology. It was good to see some of the same principles I implemented at the company I work for.
After that I went to see Richard Galvan’s session about cross platform mobile development. This session was about the Flash platform specifically, and for me this looks like the easiest route to go. I really wanted to jump on the mobile development train after seeing this talk.
The day continued with Joel Gethin Lewis. I was really impressed by the way he used technology to help people. He showed how they developed an application to help treat autism, and made it opensource.
And then the evening session: Cyriak Harris. I really like this man’s work. If someone ever asks me “hey, do you know someone who would be good to make a crazy music video”, I would reply “cyriak”. Even though he said he doesn’t really like to do that kind of work (but that was mostly because there never is much budget, right?). Seeing him work with After Effects makes me want to learn After Effects better myself. But I would never be able to pull off what he is doing with it… so watching him was both inspiring and demotivating ;)

Day 3:
Day 3 was “elevator pitch” day for me! Just like last year, I was part of the elevator pitch session this year. Last year I had some computer problems, and when John asked me if I wanted to do it again this year… I just couldn’t say no. Last year was a blast, and this year was even better. I wasn’t as nervous as last time. I had this “been there, done that” air around me .  I even thought that the nerves wouldn’t kick in at all… but 3 seconds before I had to go up on stage, my heart started pounding.  Believe me, standing there knowing there are so many people in the room, and you only have 3 minutes to bring your message across… you feel the adrenaline pumping through your veins!
I can recommend it to everyone though. If you ever have the chance to participate in the elevator pitch, don’t hesitate.
You can see a bootleg of my presentation here. If FOTB releases an official video I will definitely post it here.

After the elevator pitch, Thomas Vian gave us some insight on how to build a Flash game using an engine. He showed some examples of Flixel, FlashPunk, and PushButton. In Flash I’ve never used an existing engine before. I have always written my games from scratch, or by using my own framework. The problem is, if you have only 1 week to produce a (mini) game, then learning to use a game engine seems like a waste of time. But after seeing Thomas’ session I will definitely explore some of these engines so next time I’m given an impossible deadline for a game, I can save time instead of losing some.
After that I went to see the jam session. The jam session is always a good session to see some of the highlights from talks you may have missed. Luckily GMunk got out of bed in time, and he talked about how the titles he did for the event were made, and what they mean (yes, there’s a story behind it ;) ). Check the video here.
Seb Lee-Delisle showed the Pixelphones application he demoed the day before. You can see a video of this application here.

Then I wanted to see Jared Ficklin, but I ended up in James White’s session. I didn’t regret ending up there, as it was a very inspiring talk.

The day ended with Joshua Davis speaking. Or should I say performing ;) Even though I have seen Joshua speaking before, and he shows you a lot of the same work each time you see him. Somehow his sessions remain inspiring. A great talk to end the event!

The future?
The last few years Flash On The Beach was more and more open. The event was less and less centered around Adobe products. John Davey announced he will rebrand the event. So 2011 was the last time FOTB took place. I’m looking forward to see how “FOTB 2.0″ will look like. But I hope,  as a Flash and Flex developer, that Flash and Flex are not left out completely. If so, I will have to look elsewhere. But if John continues this event more or less like it was before, then 2011 will not be the last time I travelled to Brighton.

Oh, and here are some pictures I took at the event.

I haven’t posted any new generative design for a while now. And that’s not because I’m not creating any new pieces.
I’m working on a new style, and I didn’t want to post anything until I was satisfied with the results.
But now it’s time to reveal some new work:

Generative abstract


Generative abstract

Generative abstract

I want to use these designs for laptop covers, wall prints and furniture prints. I’m still experimenting. Once prints are available I will post the link. In the meantime, feel free to let me know what you think of the new style.

Recently, I have been experimenting with Molehill. Molehill is the codename for the new 3D rendering API that will make its way into Flash. If you install the flash player incubator build of the Flash player, you can already experiment with it.
Besides using this new technology for my games, I’m hoping I can also use it for audio visuals and generative artwork (please Adobe, provide a way to render the 3D stage to a bitmap).
Here’s an audio visual I made yesterday (don’t bother clicking the link if you don’t have the flash player incubator build installed yet, it won’t work):

There’s a framerate info panel at the top of the screen. I’m curious to know what framerates you are getting. I was hoping for higher framerates, as I have seen demo’s with a lot more polygons (my scene has less then 1000 polygons), and those were running faster than my demo. I must be doing something wrong. Or maybe it’s just because Broomstick, the Molehill enabled version of Away 3D, is still under development.
I’ll be doing more tests soon, and I’ll post the results here.

In April 2009 I wrote an article on Flash encryption. You can read that article here. I explained how to encrypt an SWF file, load it at runtime, decrypt it using actionscript and add the decrypted SWF file to the display list. In that way the decrypted SWF only existed in memory.
This was a great way to add an extra layer of protection to protect your actionscript source code and assets. However, people could still easily download the encrypted file, decompile the loader SWF to get the key, and then decrypt your SWF using that key.
To make it a little harder to crack, I’m now embedding the encrypted SWF file as a ByteArray into another SWF. In this way, if you want to decrypt the SWF you have to find a way to extract the bytes from the encapsulating SWF. This is not an impossible task, but it will keep most people out.

Here’s how you embed an encrypted SWF in another SWF:

  • Download the XOR-tool. This is a little AIR application I made to encrypt your files using the XOR algorithm.
  • Select the SWF file you want to encrypt, choose a key, and encrypt your SWF.
  • Create a new actionscript project in Flash Builder, and add the following code to your main class:


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    //copyright 2011 Ward De Langhe
    //http://www.veryinteractivepeople.com
    package
    {
        import flash.display.Sprite;
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;

        import flash.utils.ByteArray;
       
        [SWF(width="770", height="490", frameRate="31", backgroundColor="#FFFFFF")]
        public class ProtectedSWF extends Sprite
        {
            //replace "encrypted.swf" to the name of your encrypted SWF file
            [Embed(source="encrypted.swf", mimeType="application/octet-stream")]
            private const EmbeddedSWF:Class;
           
            //put your encryption key here
            private static const KEY:String="WRITE_YOUR_OWN_CODE!";
           
            public function ProtectedSWF()
            {
                var binaryData:ByteArray = new EmbeddedSWF();
                if(binaryData.length != 0)
                {
                    XOR(binaryData,KEY);
                    var animationLoader:Loader = new Loader();
                    animationLoader.loadBytes(binaryData);
                    addChild(animationLoader);
                }
            }
            private static function  XOR(binaryData:ByteArray, key:String):void{
                var keyIndex:Number=0;
                for(var i:Number=0;i<binaryData.length;i++){
                    binaryData[i]=binaryData[i]^key.charCodeAt(keyIndex);
                    keyIndex++;
                    if(keyIndex>=key.length)
                        keyIndex=0;
                }
            }
        }
    }
  • Place the encrypted flash file in your source folder, and make sure it’s name corresponds to the one in the code. And change the key in the code to the key you used to encrypt the file.
  • Compile your project. The encrypted SWF is now embedded in another SWF. If you run this SWF you will see your original SWF movie.

How to make it harder to decrypt/decompile:

Here are some ideas to add some extra protection:

  • Repeat the process a couple of times, preferably using different keys
  • Hide the key in a second encrypted SWF
  • Obfuscate your code before encrypting it. If people manage to decrypt the file, they will still have trouble copying your code.

Problems:

One of the downsides of this technique is you can no longer pass Flash vars. If you load an SWF into another SWF it is possible to pass Flash vars trough URL parameters. However, in this case we are injecting the bytes directly into a Loader object. And because of this we cannot pass Flash vars.

For a project at Epyc, I had to write a PHP module to convert a PDF file into a series of images. This is a key feature of the application I’m developing, so it was very important it worked flawlessly.
I have programmed some modules that generated PDF files before, but never the other way around. So my first stop was google.
Almost everyone will tell you to use ImageMagick and Ghostscript. ImageMagick uses Ghostscript to interpret the PDF file, so that’s why Ghostscript must also be installed on the server.
However, we just couldn’t get ImageMagick to communicate with Ghostscript. ImageMagick always gave us the following error:

Postscript delegate failed

It looks like a lot of people run into this problem, and I just couldn’t find a solution.
I was about to give up, when one of my collegues pointed out I could simply call Ghostscript directly through the command line (thanks Frederik ;) ). In this way I don’t have all the fancy features of ImageMagick, but to edit the converted images I can use the PHP GD library, so I didn’t really need ImageMagick. Ghostscript ran fine on our server, so this was worth a shot.

So, here’s how you call Ghostscript directly trough PHP using the “exec” function:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
    ini_set('display_errors', 1);
    $pdf='test.pdf';
    $quality=90;
    $res='300x300';
    $exportName="pdf_export_" . time();
    $exportPath=realpath(dirname(__FILE__))."/$exportName/fullres/%03d.jpg";
   
    mkdir(realpath(dirname(__FILE__))."/$exportName");
    mkdir(realpath(dirname(__FILE__))."/$exportName/fullres");
   
    set_time_limit(900);
    exec("'gs' '-dNOPAUSE' '-sDEVICE=jpeg' '-dUseCIEColor' '-dTextAlphaBits=4' '-dGraphicsAlphaBits=4' '-o$exportPath' '-r$res' '-dJPEGQ=$quality' '$pdf'",$output);
   
    for($i=0;$i<count($output);$i++)
        echo($output[$i] .'<br/>');
?>

This script creates a new folder for the export, and creates a subfolder named “fullres”. The exported images will be placed in this folder. When Ghostscript completes its job, the console output is rendered, so you can see what happened behind the screen.