Skip to main content
gonMiguel
Inspiring
December 10, 2013
Answered

NativeWindow not Working ?

  • December 10, 2013
  • 2 replies
  • 1392 views

Hi everyone.

I´m trying to simple make an aplication on AIR for desktop with the window on top.

It seems simple as :

debug.text = "start";

stage.nativeWindow.alwaysInFront=true;

stage.nativeWindow.activate();

debug.text = "done";

No errors on compiler, window will not get on top of others , and code after this lines not called....

I´m using Flash Professional CC and AIR 3.4 (Just downloaded this morning...)

Anyone knows what´s not correct !?

Can you help me !?

This topic has been closed for replies.
Correct answer sinious

After a while....

If i publish as a "projector" it doesn´t work....

Also if i publish yours as "projector" it doesn´t work as well... It´s working when i hit F12 and test publish from flash pro... but after publish (even if not projector) it doesn´t stay on top..

Did you test it after publishing ?

Thanks ?


Yes I published it to a native installer with captive runtime, installed it on my computer and ran it. The window stays on top of other windows.

Here's a video of the final EXE running after it was installed. You can see the windows can't get on top of it:

http://www.ertp.com/tmp/ontop.mp4

2 replies

sinious
Legend
December 10, 2013

Can't hurt to grab the latest AIR 3.9 here:

http://www.adobe.com/devnet/air/air-sdk-download.edu.html

Aside that, what OS?

On Windows that code works exactly as expected. The window will stay on top of everything else that isn't in the same depth stack (any other "always on top" windows may go over it). Otherwise just don't try to go always on top and fullscreen due to the limitations on this.

You don't need to throw an activate() either, unless you're in a situation where you noticed your app was deactivated (unfocused) and you wish to return your app to focus.

Are you making a kiosk?

gonMiguel
gonMiguelAuthor
Inspiring
December 10, 2013

Sinious, i´m doing it on Windows. I don´t need fullscreen .

I trying to do something like a widget thats on top of all windows (not a kiosk)

I´m at the moment updating sdk, i´ll be in touch.

Thanks

Inspiring
December 10, 2013

Caveats are found here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/NativeWindow.html#alwaysInFront

  • Some Linux window managers do not display windows that have the alwaysInFront property set to  in front of fullscreen windows.
  • On Mac® OS X, setting alwaysInFront to true will have no effect when the displayState property of the window stage is fullScreen or fullScreenInteractive.

It is generally not advisable to use that feature at all, since it ovevrrides the default behavior of any OS.

gonMiguel
gonMiguelAuthor
Inspiring
December 10, 2013

Actually im doing it on Windows, but then i want to do it in OSX as well.

I´m not changing displayState, neither to fullScreen neither to fullScreenInteractive .