Today I’ve learned that the only way, tested so far, to get parent paths from the applicationDirectory is using the File object constructor:
One of the most famous feature of the Air framework is the ability to perform the “Drag&Drop” behaviour with your application.
This sample code show how to detect the “drag” action, check the file type then do the proper action on “drop” step.
The following part of code set the listeners you need to create your Drag&Drop feature. As mentioned in the code, you need a DisplayObject as canvas to avoid an issue which break the listeners (I don’t know whether it is a known bug..)
Ok, this is beyond the tiny concept. This very tiny utility just show the keyCode for Actionscript based on its Keyboard mapping. I use it quite often to know which keyCode use during my development test with keyboard.
You may notice the function ‘getFocusMe’ which is needed to preserve the focus to the stage because accidental click on other DisplayObject will change it, breaking the listener of the Keyboard.
In this quick tutorial I will show the piece of code to prompt the dialogue box to the user to save an image to file system.
Since an image file is a BitmapData object, you can draw anythink on it before save.
Ok, before start, you have to download the necessary library to encode you image. It’s free and provider directly by Adobe on Google Code; Download it and place it on your ClassPath and import the JPGEncoder class:
Comments