This application demonstrates how to use AIR 2.0 Native Process with Java program. Air application sends String to Java program, Java program reads it and sends back to AIR app. Before packaging the ‘NativeProcessDemo’ application into an AIR file, make sure you have added the following line to application description file <supportedProfiles>extendedDesktop desktop</supportedProfiles>. Next, use command line tool to package an AIR app in a native installer.
NativeProcessDemo.mxml (MXML, 12 KB),
HelloWorld.java (JAVA, 1 KB)
Strongly typed messages are used to communicate between cores in PureMVC MultiCore application with Pipes Utility. Below is a simple example of a custom pipe message class, and a JunctionMediator using the custom message. Message names are defined in the message itself which makes the message handling very easy.
In above image you can see the custom application updater interface I have created for my NoteList application. You would see this updater interface only if updated application is available for download. Clicking the ‘Download and Upload’ button downloads updated .air file and updates current application.
Read more, view source code
Adobe AIR applications can detect if user is actively using a computer. The NativeApplication object dispatches two events:
userIdle event – user is not using a computer,
userPresent event – user is using a computer again.
The following lines of code set the idle threshold to 20 seconds and listen for both the userIdle and userPresent events:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
private function init():void
nativeApplication.idleThreshold = 20;
private function userIdleHandler(event:Event):void
private function userPresentHandler(event:Event):void
There are plenty examples out there on how to add and remove leaf nodes from a Tree control at run time, one of my favorite is Working with tree controls tutorial by Adobe.
Now it’s time to learn more advanced stuff: auto select for new created item. This would be very easy to accomplish with List control. You would probably use ArrayCollection as a dataProvider, call addItem(item:Object), keep track of that item index, and then use list.selectedIndex = index.
Unfortunately this is not easy with Tree control. Tree control could have opened and closed nodes. If the nodes in the tree control are collapsed, the selectedIndex is different than when all the nodes are expanded. Instead of using selectedIndex you want to loop through all nodes to find a new item’s index.
Jump into code
I’ve setup my Flex Builder for Flex 3.3 SDK and Flash Player 10 as described in this article. I noticed that BitmapData class doesn’t show anymore.
Any thoughts on this?
Above Problem Solved. (Updated)
Read the Flex 3.3 SDK
You need to:
1. Download Flex SDK zip file.
2. Uninstall current Flash Player.
3. Install Flash Player from /runtimes/player/10/win/
Thanks to the Flex Community(Michael Borbor).
In this example i want to show you how to download remote image(jpg or png) and save it to the desktop.
Continue reading ‘Downloading and Saving Images to the desktop with AIR’ »
Each file is about 4MB, 2639×3949 pixels. Download posters(zip file)
You can order a set of Flex, AIR, and ActionScript posters(2 feet by 3 feet) from Adobe website.
NOTE: you need to have an Adobe ID and a valid Flex 3 serial number to order them
PDF versions appeared again on http://flex.org/poster/posters.zip