I reported a bug on apollocoder and Mike Chamber forwarded it to their QA team :) :) :)
Anyways, The bug is :
Using ScreenMouseEvent.CLICK , something like :
SystemTrayIcon(Shell.shell.icon).addEventListener(ScreenMouseEvent.CLICK,showScreen)
Gives error:
TypeError: Error #2007: Parameter type must be non-null.
Work arround, Hardcode the "click" string as :
SystemTrayIcon(Shell.shell.icon).addEventListener("click",showScreen)
The problem does not occur in :
ScreenMouseEvent.RIGHT_CLICK
ScreenMouseEvent.RIGHT_MOUSE_DOWN
ScreenMouseEvent.RIGHT_MOUSE_UP
Wednesday, October 10, 2007
Tuesday, October 9, 2007
Standard chrome of air
D I unnecessarily used standard chrome of air??? ! If I am using the custome chrome, its not letting me set up the native menu option, I get an error like :
" Native menus are supported only in case of standard chrome?? "
what is this??
* Full screen in not supported if we are having the transparent window....??
*Native menus are supported only in case of standard chrome??
" Native menus are supported only in case of standard chrome?? "
what is this??
* Full screen in not supported if we are having the transparent window....??
*Native menus are supported only in case of standard chrome??
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">
<mx: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>
>
<?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">
<mx: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>
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. 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 !:) )
- stage.window changed to stage.nativeWindow
- We can no more write to appresource directory we have to write in appstorage directory.
- 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.
- File.resolvePath changed from File.resolve
- ....More will come...
Subscribe to:
Posts (Atom)