AIRでウィンドウドラッグとウィンドウを常にトップに表示する方法
AIRでウィンドウドラッグとウィンドウを常にトップに表示する方法です。
ウィンドウのドラッグ方法
mouseDown="{this.nativeWindow.startMove()}"
ウィンドウを常にトップに表示
alwaysInFront="true"
#後輩に教えてもらった\(゜ロ\)(/ロ゜)/
こんな感じのアプリが簡単に作れちゃう。
サンプルなAIRはこちら
http://moeten.info/flex/20080511_airTest/main.air
AIRなソースはこちら
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="349" height="282" backgroundAlpha="0" showGripper="false" showInAutomationHierarchy="false" showStatusBar="false" showTitleBar="false" borderStyle="solid" borderThickness="0" alwaysInFront="true" creationComplete="{myShow.play()}" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import mx.effects.easing.*; ]]> </mx:Script> <mx:DropShadowFilter blurX="4" blurY="4" color="0x000000" id="dsf"/> <mx:Move id="myShow" target="{this}" xFrom="-100" xTo="200" yFrom="-100" yTo="200" easingFunction="Back.easeOut"/> <mx:Canvas id="myCanvas" mouseDown="{this.nativeWindow.startMove()}" filters="{[dsf]}" scaleX="0.5" scaleY="0.5"> <mx:Image x="267" y="52" id="kami_migi" source="hatyune/kami_migi.png"/> <mx:Image x="166" y="20" id="ude_migi" source="hatyune/ude_migi.png"/> <mx:Image x="354" y="31" id="karada" source="hatyune/karada.png"/> <mx:Image x="507" y="160" id="naruto1" source="hatyune/naruto.png"/> <mx:Image x="378" y="150" id="naruto2" source="hatyune/naruto.png"/> <mx:Image x="380" y="93" id="kao" source="hatyune/kao.png"/> <mx:Image x="534" y="42" id="kami_hidari" source="hatyune/kami_hidari.png"/> </mx:Canvas> </mx:WindowedApplication>