Pages

Friday, October 5, 2007

Air App in system Tray with menus

Here is the sample code :

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
height="400"
width="500"
creationComplete="init()"
showFlexChrome="false">
<mx:Script>
<![CDATA[
import mx.core.BitmapAsset;
import flash.system.Shell;
import mx.controls.Image;
public var _root:NativeMenu
[Embed(source="icons/AIRApp_16.png")]
[Bindable]
public var imgCls:Class;
function init(){
_root = new NativeMenu()
this.nativeWindow.x = 0
this.nativeWindow.y = 0
trace(Shell.supportsSystemTrayIcon )
var editMenu:NativeMenuItem = _root.addItem(new NativeMenuItem("exit"));
editMenu.addEventListener(Event.SELECT,exitApp)
var imgObj:BitmapAsset = new imgCls() as BitmapAsset;
Shell.shell.icon.bitmaps = [imgObj.bitmapData]
SystemTrayIcon(Shell.shell.icon).menu = _root;

}
public function exitApp(event){
stage.nativeWindow.close()
}
]]>
</mx:Script>
<mx:Canvas height="100%" width="100%" borderStyle="solid" borderColor="#18252E" cornerRadius="20" backgroundColor="#605050">
&ltmx:Button x="54" y="43" label="Close window" click=" stage.nativeWindow.visible=false"/>
</mx:Canvas>
<mx:Image id="myImageRaw" source="{imgCls}" visible="false"/>
</mx:WindowedApplication>

>

Thursday, October 4, 2007

Making air window fullscreen size

<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
showFlexChrome="false"
height="{ Capabilities.screenResolutionY}"
width="{ Capabilities.screenResolutionX}"
creationComplete="init()">

<mx:Script>
<![CDATA[
function init(){
this.nativeWindow.x = 0
this.nativeWindow.y = 0

}
]]>
</mx:Script>

Wednesday, October 3, 2007

changes in AIR sdk:

  1. 1. name space changed: "http://ns.adobe.com/air/application/1.0.M5" from and "http://ns.adobe.com/air/application/1.0. The structure of the app.xml got changed (we know !:) )
  2. stage.window changed to stage.nativeWindow
  3. We can no more write to appresource directory we have to write in appstorage directory.
  4. fullscreen mode :The full screen mode does not work if the application is set to transparent :( The work around is to set one transparent png as the background image for window and then make it full screen.
  5. File.resolvePath changed from File.resolve
  6. ....More will come...

Tuesday, October 2, 2007

Flex builder beta 2

Yes! flex builder beta2 got released today..with lots of new features. Get it from here. Apart from the various new features in FB3 -beta2, release notes talks about the Installing and Configuring Flex Automated Testing. Which I do not understand much. The small list of features in FB3 is:
  • Native support for Adobe AIR – Flex 3 introduces new components and incorporates the Adobe AIR development tools into the SDK and Flex Builder.
  • Persistent framework caching – You can make Flex 3 applications as small as 50K when leveraging the new Flash Player cache for Adobe platform components.
  • Flex Builder productivity enhancements – Flex Builder 3 introduces refactoring support, new profilers for performance and memory tuning, and code generation tools for data access.
  • Integration with Creative Suite 3 – The Flex Component Kit for Flash CS3 allows Flash CS3 users to build components that can be seamlessly integrated into a Flex application, while Flex Builder 3 adds new wizards for importing assets from CS3 applications as skins.
  • Advanced DataGrid – The Advanced DataGrid is a new component that adds commonly requested features to the DataGrid such as support for hierarchical data, and basic pivot table functionality.
  • First steps toward open source Flex. As a first step toward making Flex an open source project, we've opened up the Flex and Flex Builder bug tracking system to the public, as well as published detailed roadmap information.
The Details we can find on : http://www.adobe.com/devnet/flex/articles/flex3_whatsnew.html and Flex Interface Guide(http://www.adobe.com/devnet/flex/?navID=fig). Gotta get fast on track to keep up with new things

Monday, October 1, 2007

Air beta 2

Adobe released there Beta 2 runtime. Release notes are on labs . (here :)) . The doc says:

Support for AIR Beta 1

AIR Beta 1 will expire on December 11th 2007, so all applications that you have created for AIR Beta 1 need to be migrated to AIR Beta 2 if you want to run your applications after that date.

So do it as soon as possible. :) there are few changes.. minimised to systemtray functionality added ,initialWindow tag added in the descriptor , changed to http://ns.adobe.com/air/application/1.0.M4.

Details are on labs.