Bonjour,

je suis en train d'essayer de bâtir une application AIR comportant plusieurs fenêtres : une principale et plusieurs secondaires...
La fenêtre principale (celle de base de l'application) doit toujours être derrière les fenêtres secondaires. Elle doivent être également groupé entre elles lorsque je passe ou revient d'une autre application à la façon d'un PhotoShop et de ses palettes.

1er souci : lorsque je clique sur une fenêtre principale celle-ci passe en premier plan. J'ai donc fait en sorte qu'a l'activation des fenêtres (event : WINDOW_ACTIVATE) l'ordre des fenêtres soit refait.

2ème souci : lorsque je déplace la fenêtre principale ou que je la redimensionne via respectivement nativeWindow.startMove() et nativeWindow.startResize() celle-ci repasse devant...
D'après la doc, j'ai vu que les événements NativeWindowBoundsEvent.MOVE et NativeWindowBoundsEvent.RESIZE sont sensés être lancés à la fin de l'opération a prioris... j'ai donc aussi forcer l'ordre des fenêtres à ce moment là...
En fait ces événements sont lancés à chaque image tout du long de ces opérations: ma fenetre principal passe bien derrière à ce moment là mais en tremblotant...
Mais lorsque je relâche le bouton de la souris, le fenêtre principal arrive devant... je n'arrive pas à trouver quelle evenement je pourrait écouter pour forcer une dernière fois l'ordre des fenêtres.

Quelqu'un as t'il une idée ?

Voici le code :

Action Script

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" showFlexChrome="false"
themeColor="#7AB61A" windowComplete="init(event)" windowActivate="winAct(event)">
<mx:Script>
<![CDATA[
import mx.core.Window;
import mx.events.AIREvent;
import flash.events.NativeWindowBoundsEvent;

[Bindable]
[Embed(source="fond.png",scaleGridLeft="1",scaleGridRight="788",scaleGridTop="21",scaleGridBottom="575")]
private var background:Class;

private var newWindow:Window;

private function init(event:AIREvent):void
{
this.nativeWindow.addEventListener(NativeWindowBoundsEvent.MOVE, moveList);
this.nativeWindow.addEventListener(NativeWindowBoundsEvent.RESIZE, resizeList);
this.nativeWindow.addEventListener(

newWindow = new Window();
newWindow.systemChrome = NativeWindowSystemChrome.NONE;
newWindow.transparent = true;
newWindow.title = "New Window";
newWindow.width = 200;
newWindow.height = 200;
newWindow.addEventListener(AIREvent.WINDOW_ACTIVATE, newwinAct);
newWindow.open(true);
}

private function winAct(event:AIREvent):void
{
trace('winAct');
nativeWindow.orderToFront();
newWindow.nativeWindow.orderInFrontOf(this.nativeWindow);
}

private function newwinAct(event:AIREvent):void
{
trace('newwinAct');
nativeWindow.orderToFront();
newWindow.nativeWindow.orderInFrontOf(this.nativeWindow);
}

private function moveList(event:NativeWindowBoundsEvent):void
{
trace('moveList');
//nativeWindow.orderToFront();
newWindow.nativeWindow.orderInFrontOf(this.nativeWindow);
}

private function resizeList(event:NativeWindowBoundsEvent):void
{
trace('resizeList');
//nativeWindow.orderToFront();
newWindow.nativeWindow.orderInFrontOf(this.nativeWindow);
}

private function mouseUpList(event:MouseEvent):void
{
trace('mouseUpList');
}
]]>
</mx:Script>
<mx:Canvas top="0" bottom="0" left="0" right="0" backgroundImage="{background}" backgroundSize="100%">
</mx:Canvas>
<mx:Canvas left="0" right="0" top="0" height="21" mouseDown="nativeWindow.startMove()"/>
<mx:Canvas width="20" height="20" right="10" bottom="10" mouseDown="nativeWindow.startResize()"/>
<mx:Button right="33" top="3" width="15" height="15" toolTip="Minimize" click="nativeWindow.minimize()"/>
<mx:Button right="18" top="3" width="15" height="15" toolTip="Maximize" click="nativeWindow.maximize()"/>
<mx:Button right="3" top="3" width="15" height="15" toolTip="Close" click="nativeWindow.close()"/>
</mx:WindowedApplication>


Merci d'avance pour votre aide smile.gif