Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

NativeWindow not Working ?

Explorer ,
Dec 10, 2013 Dec 10, 2013

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 !?

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 10, 2013 Dec 10, 2013

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

Translate
Guru ,
Dec 10, 2013 Dec 10, 2013

Caveats are found here:

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

  • 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 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 .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2013 Dec 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 10, 2013

Sinious, i just updated so now i am targeting air 3.9.0.1380 for Desktop.

I´m getting the same behaviour...

But ... if i go ... and debug it on Air SDK , it works...  if i publish.. it doesnt... !

Any idea ?

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2013 Dec 10, 2013

Here's the quick example app I used. The password for the cert is just '1234' or use your own temp cert. After published, installed and ran the window stays on top of everything for me.

Example CC Source (code just in frame 1):

http://www.ertp.com/tmp/AlwaysOnTopCC.zip

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 10, 2013

Very weird...

Your project works... when i copy to mine... mine don´t work..

If i start a new air project and copy it ...it works...

Thank you for your support.

I don´t know what was the issue, but i start a new proj .. and it will work as expected...

That´s a life of a programmer... !

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 10, 2013

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 ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2013 Dec 10, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2013 Dec 10, 2013

Thanks, now i got it !

I get it working

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2013 Dec 10, 2013
LATEST

You're welcome and good luck!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines