Home > Flash development > The Flash universe is 200 million pixels wide. But …

The Flash universe is 200 million pixels wide. But …

October 18th, 2007 Randy Leave a comment Go to comments

I was encountering some odd beviour with the Flash drawing api with RUNNINGMAP and my hunch was that it was caused by drawing the lines too far off the stage. At the behest of Tom Ortega (360Flex Deity) I built a little experiment to test my theory, which is shown below.

If you leave the default x and y values and click “Move the Blob”, the Blob will move 200,000 pixels to the right (off stage, somewhere in Saskatoon). You should see that the line connecting the two balls gets really fat and dragging the orange ball around will show that Flash is not painting the stage properly. My tests with RUNNINGMAP show this painting error occurs when a line is 25,000 or more pixels off-stage.

The first thing I hear you saying is “Who wants to draw 25,000 pixels off-stage anyway?” Uh, me. RUNNINGMAP allows you to draw routes on a map, which may get fairly long. As the user drags the map to new geography, the lines get further and further off-stage. This experiment proves my hunch was correct and I have since fixed the bug in RUNNINGMAP.

I also now know there is virtually no limitation for placed moveiclips. You can play with the x and y values and repeatedly click “move the blob” to cause the Blob to move further and further away. You can reliably move the Blob 100 Million pixels in either direction. Sometime thereafter the value crashes and is assigned a value of -107374182.4. Clicking reset shows that this is not unrecoverable. We now know how big the Flash universe is. Just don’t expect to draw all over it.

UPDATE: This swf was updated as AS3.

Vote for this bug: https://bugs.adobe.com/jira/browse/FP-690

Categories: Flash development Tags:
  1. October 19th, 2007 at 00:36 | #1

    Out of curiosity, is this test AS2 or AS3? Also, in your experiments did you ever test drawing BitmapData to see if it has the same limitations?

    By the way, by simply adding -20000 in he y field my blob ended up in Flin Flon Manitoba.

  2. Randy Troppmann
    October 19th, 2007 at 07:57 | #2

    Hey Scott. This is AS2. An earlier version I did in AS3 showed the same result with respect to the Flash universe: 200 Million pixels wide. I have not tested the drawing API in AS3 yet. Nice idea with BitmapData. I will try that too.

    Flin Flon … Nice! Will post Fla if anyone is interested.

  1. No trackbacks yet.