Always on top Adobe Air - actionscript-3

I know about nativeWindow.alwaysInFront property and I do use it, however if another application creates a window which is set to be topmost as well, it does overlay my AIR app. For example, Teamviewer message windows.
Is there a way to achieve absolute topmost-ness ?

No.
But setting alwaysInFront to false, and to true again, will put your app on top again.

Related

is it possible to pin AIR app over any opened windows?

I need to pin AIR application over other windows, I mean, regardless if AIR application is in focus or not, it must not hide, it always must be shown, whatever other program I activate or work with, AIR application must be over every window always. Is it possible? If it is, please show me the function (example code will be better :) ) which does it, incase if AS3 has one.
You're looking for the alwaysInFront property of the NativeWindow class:
The alwaysInFront property specifies whether this window will always be in front of other windows (including those of other applications).
The following example forces a window to be displayed in front of all
other windows (that are not similarly forced to the front):
windowObj.alwaysInFront = true;
Another example with a reference to a display object on the window stage:
displayObject.stage.nativeWindow.alwaysInFront=true;

Adobe Flash Builder 4.7 Full Screening Scaling Problems

In my Adobe Air application, I have a room and my player that can walk around it. I set it so it automatically opens in fullscreen, however, when you exit fullscreen it doesn't scale anything, so it just shows you the edge of the room, where you can't see the player or anything else. How do I make it so that when you exit fullscreen, everything will scale down to the windowed version, and back again? This is in Adobe Flash Builder 4.7.
I tried scaling everything down by putting an If statement in an update function, that constantly checks if the window is full screened or not, and if not, it'll scale the x and y down by .5, and if full screened again, it'll scale it back up by 1. The player however changes position, and if I try to make the X equal it it just does it again if I move the player, so it doesn't work. I've also tried verticleCenter and horizontalCenter on both the player and room, it also doesn't work.
What I'm wondering is if there is a stage.autoScale line that can solve everything, or if I have to do it manually another way like I've tried.
So you got 2 options here.
Check for fullscreen event and then in the listener function scale everything according to your logics. This will give you more control over the scaling and visual display of your components and graphics. You can find a working example for fullscreen event handling at http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS2E9C7F3B-6A7C-4c5d-8ADD-5B23446FBEEB.html
Allow FP to scale the stage according to the window size. This can be achieved by setting up stage.scale mode. There are couple options which you can find at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageScaleMode.html. Use the one best suit for your application.
I would prefer using first method. Hope that make sense.

How to prevent AIR application from jerking around while dragging?

I've created an AIR application and it seems to be working fine but when I drag the title bar to move the native window it shakes violently and have seizures while it's dragging about.
FYI It does eventually end up where I want it to be when I stop moving the mouse.
I'm using Flex 4.6 and AIR 3.6 on Mac OSX 10.10.5. It's a s:WindowedApplication I'm also using the DragManager on a list in part of the application if that matters but it is not enabled until the user clicks into the list and moves more than a certain number of pixels.
Here is my descriptor file minus name and version info:
<application xmlns="http://ns.adobe.com/air/application/3.6">
<initialWindow>
<autoOrients>false</autoOrients>
<fullScreen>false</fullScreen>
<visible>false</visible>
</initialWindow>
</application>
On initialize I run this:
protected function initializeHandler(event:FlexEvent):void {
width = Capabilities.screenResolutionX * .96;
height = Capabilities.screenResolutionY * .9;
nativeWindow.x = (Screen.mainScreen.bounds.width - width)/2;
nativeWindow.y = (Screen.mainScreen.bounds.height - height)/2;
}
UPDATE:
I removed the main view component so it is an empty application and it drags around smoothly.
UPDATE 2:
I added the main view back in and dragged around step by step along the way. It appears to start happening when I've loaded a second Application (called a sub application) into the main application. I'm not sure though.
This happens in numerous number of my applications. It is probably because I have a component inside my application file set to size to 100% of the application. But I have not verified this on all my apps.
The solution is to resize the AIR app. After I resize it it works fine. I can drag it around and it works as expected. I think this is an AIR bug.

how to give drop shadow for adobe air window?

I am developing adobe air application.
I am trying to give drop shadow around window in WindowedApplication skin class, But it is not taking the shadow.
I want to give shawdow behind window as seen in Microsoft link application.
Any suggestion or solution are welcome
Thanks
Set none and true in your app descriptor XML to get a transparent and chromeless native window.
Then you would have to add any window decorations you might need back, and add the drop shadow to the top most parent sprite of your window (probably also making the parent sprite's origin and size inset within the native window to account for the drop shadow area).
You can try this example as well

FusionCharts + Prototype Modalbox + Google Chrome = Browser View Bug

I am hoping that someone can help shed some light on the underlying issue causing the bug that you see here:
As you can see, the FusionChart is incorrecly overlaying on top of the Modalbox when the it is opened. This issue only occurs in Google Chrome. All other browsers are ok.
Any ideas on the underlying issue here? And what can be done?
Last time I messed with overlaying a div on top of Flash (What is going on here) I could get it to work on all platforms except Linux. Are you using a Linux distribution? If not the solution is usually to add wmode="transparent" to the embed.
Otherwise, the only solution is to set .style.display="none"; on the FusionChart whenever the Modalbox is shown and .style.display=""; when the Modalbox is closed.
When Flash objects appear on top of every other HTML elements, it is most likely because the window mode (wMode) parameter of the Flash movie is set to "window".
In FusionCharts, one can set wMode in two ways:
A. Using .setTransparent() JavaScript function
setTransparent(false) changes the window mode to "opaque" and that solves the issue of FusionCharts appearing on top of modal windows and lightboxes.
setTransparent(true) also serves the same purpose. It sets wMode to "transparent". (Any value for wMode, except "window" would do the trick.)
Example JavaScript:
var myChart = new FusionCharts( "FusionCharts/Column3D.swf",
"myChartId", "400", "300", "0", "1" );
myChart.setXMLUrl("Data.xml");
myChart.setTransparent(false); // set wMode to opaque
myChart.render("chartContainer");
Since FusionCharts 3.2, setting setTransparent(null) restores wMode to "window" and you would NOT want to do that for your case! :)
B. Using wMode property during new FusionCharts construction
Also since FusionCharts 3.2 introduced object-style construction method, the value of wMode can be provided while doing new FusionCharts(...) itself by providing wMode: 'opaque'