Posts Tagged ‘AIR’
Digital Graffiti – Spray Demo
December 19th, 2008 • 6 comments AIR, ActionScript, Flash, Physical Computing, Projects
Tags: ActionScript, AIR, Arduino, AS3, Physical Computing, RFID
The canvas with the van is not very nice, but just to show you a demo of the spray can. sorry for my bad spraying skills. see a description of the project here.
BitmapData.draw() is limited to 4096px
December 11th, 2008 • 3 comments AIR, ActionScript, Flash
Tags: ActionScript, AIR, AS3, BitmapData, Flash
Thanks to Jens I figured out another limitation in the BitmapData class. It’s actually buried in the draw() method which doesn’t copy any pixels to the BitmapData object whose target x-/y-position is greater than 4096px (0×1000). You don’t get any error just the pixels won’t be copied. This behavior is the same in FlashPlayer 9 and 10 and of course AIR 1.0 – 1.5.
Actually this is no problem for the regular use of BitmapData in FP9 because the BitmapData size is limited to 2880×2880px but using my BitmapDataUnlimited Class and trying to snapshot a Sprite wider or higher than 4096px won’t end up in your desired result.
As you probably know Adobe changed the BitmapData limit in FP10 to a more flexible one, so you are not limited by a specific size anymore but a maximum pixel count of 16,777,215. This means that you can have a BitmapData up to 8191×2048px without using BitmapDataUnlimited but interestingly you can’t draw a Sprite with the same size to this BitmapData object. I think Adobe forgot about their own secret, undocumented »feature«.
example
Sprite: w=8191, h=2048
FP10 BitmapData: w=8191, h=2048 with snapshot of the Sprite
workaround
A workaround for that problem would be to draw everything directly to the BitmapData or if you have to snapshot a Sprite greater than 4096px you could draw it to 4096px BitmapData chunks and copy them to the huge BitmapData afterwards using copyPixels().
Update December 14th, 2008
I added a draw method to the BitmapDataUnlimited class to bypass the 4096px limit.
Using RFID in an ActionScript Application
December 9th, 2008 • 11 comments AIR, ActionScript, Flash, Physical Computing
Tags: ActionScript, AIR, AS3, Flash, Physical Computing, RFID
In order to receive tags, the RFID reader has to be activated through a click on the image. After that, the different RFID tags (sorry for my tiny tags) are used to create different forms.
Digital Graffiti – A Subculture Conquers Interactive Worlds
December 1st, 2008 • 15 comments AIR, ActionScript, Flash, Physical Computing, Projects
Tags: ActionScript, AIR, Arduino, AS3, Physical Computing, RFID
Finally I delivered my thesis project I did in cooperation with Less Rain. The subject was »Digital Graffiti – A Subculture Conquers Interactive Worlds« and it’s all about experimenting with different input devices for a physical, digital graffiti installation. The result is an Adobe AIR application using either the computer mouse, the Nintendo Wiimote or »VandalSpray« to paint digital canvases. VandalSpray is a digital spray can specifically designed for this purpose. It implements the attributes of a real spray can or at least trys to achieve them as natural as possible. Except a turnable bottom for changing the color, VandalSpray has no other interfacing elements than its real counterpart and therefore you don’t have to learn and explore the functionality first, because you intuitively know how to use it.
VandalSpray features includes:
- exchangeable caps
- color display
- digital valve system to vary the amount of »paint« coming out of the cap
- different colors
- wireless
The spray can is built upon the Arduino platform and uses different sensors and electronic modules like a RFID reader, a super bright RGB LED, a Rotary Encoder, a Bluetooth module, a force sensitive resitor (FSR) and loads of wires and solder to implement the desired behavior. For tracking the spray can I use a Wiimote and the WiiFlash ActionScript 3 library and server, but this could also be replaced by a standard webcam and an adequate tracking implementation.
Because I didn’t want to put some kind of speaker in the spray can (there was no space left anyway) the spray sound is generated from the AIR app and output on the speakers of the notebook.
VandalSpray vs. Montana spray can
VandalSpray electronics
More
http://blog.formatlos.de/2008/12/12/digital-spraycan-edemo/
http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/
FlashPlayer 10 and loading AVM1 content
November 20th, 2008 • AIR, ActionScript, Flash
Tags: AIR, AS3, Flash
I’m using some swf assets directly exported from Illustrator CS3. You can export Flash 9 swfs, but as you can’t add any code there you will always get AVM1 content (AS2.0). So it’s basically just an information in the header and maybe Adobe will put an option in the export-settings to actually publish AVM2 swfs. I haven’t tried CS4 so far, maybe it’s in there already?!
Anyway, loading this swfs and moving it to another part of the displayList didn’t cause any problems using FlashPlayer 9. In FlashPlayer 10 I get the runtime error 2180:
Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content.
There are a few options to avoid this error:
- Don’t load AVM1 content respectively create the assets in Flash to get AVM2 swfs
- Don’t move the assets in a different part of the displayList
- Change the SWF header on-the-fly
The last solution seemed to be perfect and remembering the AVM2Loader class someone created in the upcoming AS3 times it was the easiest solution without changing the workflow. Even if the author Fladdict removed the class, you can still find it on the internet at Troy Gardners blog.
Update 20.11.2008
To use this workaround in an AIR application you have to set allowLoadBytesCodeExecution = true in your LoaderContext otherwise you aren’t allowed to load the bytes of the swf.
... var loader:Loader = new AVM2Loader(); var loaderContext:LoaderContext = new LoaderContext(); loaderContext.allowLoadBytesCodeExecution = true; loader.load("file.swf", loaderContext); ...

