The Mandelbrot set in Flash

I haven’t been writing things for a while, partly because I have been taking a break from web development to work on a renderer for the Mandelbrot set (more information on the actual set can be found at the Wikipedia article on the topic).

The algorithms used to generate the set are not complex, and can be found on the Wikipedia page. The method I used was the simple one – the escape time algorithm.

First, I attempted to write a simple JavaScript script that used the canvas HTML 5 element to draw the set. However, due to limitations in the computational power of browsers, the resulting application was rather slow. It works, though!

So, I had to look around for another programming environment. In the end, I chose Flash, because it has a ready-made interface for graphics through its Display object, it is fairly fast, and it is alot like JavaScript, meaning that my original JS code didn’t have to be changed much.

The final product can be viewed in the lab (requires Flash Player 9). The source can be downloaded from here. The program is not very complex – you can zoom in and out, and change the quality at the expense of efficiency, but you can’t pan. In my opinion, however, it is quite good, considering I have never used Flash or ActionScript before, and, well, it serves its purpose. Enjoy.