Archive for September, 2008
beyond 8191px
September 23rd, 2008 • 2 comments ActionScript, Flash
Tags: AS3, BitmapData
The limit of 8191px (or 0×1FFF in hex) is probably less known but it’s actually the maximum size for DisplayObjects. If your objects width or height is greater than this limit it won’t get rendered anymore.
I mentioned in an earlier post that you can create even bigger DisplayObjects with BitmapDataUnlimited. This is still true even though there are a few restrictions.
I put together a small demo to show you my results:
http://projects.formatlos.de/spiking/1fff/
click inside the window to gain Keyboard focus,
use your arrow keys to move the container 1px (hold shift: 10px, hold alt: 100px)
add via Bitmap, no scale
... // hugeBitmapData: w=9000, h=10 container.addChild(new Bitmap(hugeBitmapData)); ...
This is probably the most convenient way to add a BitmapData to the stage. As you can see in the demo this works perfectly.
add via Bitmap, scale -> width=8191
... // hugeBitmapData: w=9000, h=10 container.addChild(new Bitmap(hugeBitmapData)); container.width = 8191; ...
The same as above, just scaling down the Sprite to 8191px. It seems to work but moving the container some px to the right shows a strange rendering behaviour.
add via Bitmap, scale -> width=8192
... // hugeBitmapData: w=9000, h=10 container.addChild(new Bitmap(hugeBitmapData)); container.width = 8192; ...
This time scaling down the Sprite to 8192px which is 1px above the limit and therefore doesn’t get rendered. moving the container some px to the right shows the same strange rendering behaviour again.
If you move the container off the stage (to the left) the exact amout of px exceeding the limit, in our case 1px, the Sprite gets rendered again. I presume Flash Player calculates the significant width/height based on the DisplayObjects bounds relating to the stage and by moving the Sprite off the stage the width/height which has to be rendered is smaller than the limit.
add via graphics, scale -> width=8192
... // hugeBitmapData: w=9000, h=10 container.graphics.beginBitmapFill(hugeBitmapData); container.graphics.drawRect(0,0,hugeBitmapData.rect.width,hugeBitmapData.rect.height); container.graphics.endFill(); container.width = 8192; ...
Apparently there is no such limit for the Graphics Object therefore you can use beginBitmapFill and drawRect to draw your BitmapData to a Sprite and scale it afterwards.
stereosucker.de
September 22nd, 2008 • ActionScript, Flash, Projects
Tags: AS3, SWFAddress, swffit
One of my latest projects just launched last week. It’s a portfolio site for visual artist and interface designer stereosucker aka Tine Päch.
The site is completely dynamic and provides deep linking and browser button support through SWFAddress.




