UnitZeroOne

Avatar

A blog written by Ralph Hauwert, freelance front-end developer, specialized in rich internet applications, games and visualisation.

Flex 2 Example : Mandelbrot explorer & what’s up BitmapData.lock() / .unLock()

I created this example somewhere during the beta phases of Flex 2, and found no reason to actually do something with it (like finishing it) anymore. But today there were some questions about the BitmapData.lock() features on the Flashcoders list, and I’d figured this might be a nice example. Originally intended as a testcase for building Flex components (I’ve come a long way with that, more on that later), this thing seemed the perfect thing to showcase the .lock method with.

Although most of the interface is not really functional yet (I’m intending on making it useable somewhere in the future), the .lock() checkbox is the thing where it’s all about here; uncheck it to make the mandelbrot drawing routine not to be preceded by al .lock() of the bitmap it’s drawing on (and closing it with an unlock again). If you don’t zoom in immediatly, and change the resolution to a very high one (Fraczilla or WS) hit draw, then uncheck and hit draw again, there should be a noticeable difference between the amount of MS it took to draw. If you zoom in further, the actual fractal calculations take alot more time then the drawing of the fractal, and the difference becomes marginal.

Still, if it takes about 200Ms longer to draw on my blazin’ fast duo core machine, the lock() feature has proven itself usefull, hasn’t it ? ;-)
You’ll need Flash Player 9.
mandel.jpg

Digg, StumbleUpon, Slash and others:
  • Digg
  • del.icio.us
  • description
  • StumbleUpon
  • Slashdot
  • Technorati
  • blogmarks
  • BlogMemes
  • Ma.gnolia

Related posts :

3 Comments, Comment or Ping

  1. felix

    Nice! Good demo of Flash 9’s speed.

  2. Martin

    Very interesting I would GUESS. for me it is just a black square.

    I got the flash 9 player, as I can see when rightclicking.

    I have hit draw, and I have clicked around in the black square and been patient.

    Is it a fault from your or my side?

    / martin

  3. Taurizio

    Plz, post source code.
    Thank you and have fun.

Reply to “Flex 2 Example : Mandelbrot explorer & what’s up BitmapData.lock() / .unLock()”

Search

Projects & Work

A selection of current work

Advertising