Re: [flexcoders] Visible issue

2009-01-23 Thread Tom Chiverton
On Thursday 22 Jan 2009, lehaianh1986 wrote:
 var systray:SystemTrayIcon = NativeApplication.nativeApplication.icon;
 systray.addEventListener(ScreenMouseEvent.CLICK,function(event:Event):void{
   stage.nativeWindow.visible = true;
 });

 but it error. The message is TypeError: Error #1009: Cannot access a
 property or method of a null object reference.

I've got something like
creationCompleteHandler:
var sysTrayIcon:SystemTrayIcon =
NativeApplication.nativeApplication.icon as 
SystemTrayIcon;
sysTrayIcon.addEventListener(MouseEvent.CLICK,undock);

undock:
if (!stage.nativeWindow.visible){
stage.nativeWindow.visible = true;
stage.nativeWindow.activate();

}else{
stage.nativeWindow.visible=false;   
}
and it works here to show/hide the main application window.

Where are you assigning the event handler, and why are you using the funny 
inline function syntax ? 
If you stop it in the debugger, what is the bit that is actually null ?

-- 
Tom Chiverton
Helping to advantageously repurpose dot-com fourth-generation experiences



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office together with a 
list of those non members who are referred to as partners.  We use the word 
?partner? to refer to a member of the LLP, or an employee or consultant with 
equivalent standing and qualifications. Regulated by the Solicitors Regulation 
Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.

[flexcoders] Visible issue

2009-01-22 Thread lehaianh1986
Hi everyone! I have problem with my AIR app. I build an AIR app with
Flex builder 3. I create a taskbar icon for my app. When I start app,
the icon visible in system taskbar. So what I want is that I minimize
the app, it is hidden until someone click to icon.

I write code to create taskbar icon object in AS3 class and in MXML
file, I call it. Here is my code in systrayap.as

var systray:SystemTrayIcon = NativeApplication.nativeApplication.icon;
systray.addEventListener(ScreenMouseEvent.CLICK,function(event:Event):void{
  stage.nativeWindow.visible = true;
});

but it error. The message is TypeError: Error #1009: Cannot access a
property or method of a null object reference.

How to solve it? I don't know how to invisible the app when I click
minimize button. 

Can anyone help me? Thank in advance!

Hai Anh



RE: [flexcoders] Visible issue

2009-01-22 Thread Alex Harui
I'm not sure AIR can do taskbar icons.  Look for examples

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of lehaianh1986
Sent: Thursday, January 22, 2009 12:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Visible issue


Hi everyone! I have problem with my AIR app. I build an AIR app with
Flex builder 3. I create a taskbar icon for my app. When I start app,
the icon visible in system taskbar. So what I want is that I minimize
the app, it is hidden until someone click to icon.

I write code to create taskbar icon object in AS3 class and in MXML
file, I call it. Here is my code in systrayap.as

var systray:SystemTrayIcon = NativeApplication.nativeApplication.icon;
systray.addEventListener(ScreenMouseEvent.CLICK,function(event:Event):void{
stage.nativeWindow.visible = true;
});

but it error. The message is TypeError: Error #1009: Cannot access a
property or method of a null object reference.

How to solve it? I don't know how to invisible the app when I click
minimize button.

Can anyone help me? Thank in advance!

Hai Anh