■目次
デスクトップガジェット作成メモ
■デスクトップガジェット作成メモ
Flash Builder 4でAdobe AIRアプリを作ってみた http://www.atmarkit.co.jp/fwcr/special/flashbuilder4/01.html AIR でタスクに常駐させメニュー処理を行う & Mac OS X でもそれっぽく対応させてみる http://1ka2ka.com/archives/200905/22_001823.html NativeWindow について http://hakuhin.jp/air/window.html ActionScript 3.0 入門1 - ムービークリップのプロパティを操作する http://yoppa.org/cucwebmov2010/1847.html ウインドウを非表示で起動して、 ASで新規にウインドウを開いて、 その中にあらかじめ作成したMCをASで配置 …とすれば、デスクトップガジェットのように起動できそう AIRガジェットをスタートアップに登録 | RontanBlog http://rontan.sakura.ne.jp/2009/04/tips_air_startup/ ウインドウの制御 http://hakuhin.jp/air/window.html http://livedocs.adobe.com/flash/9.0_jp/ActionScriptLangRefV3/flash/display/Stage.html#stageWidth http://help.adobe.com/ja_JP/AS2LCR/Flash_10.0/help.html?content=00001543.html ウインドウのドラッグ http://1ka2ka.com/archives/200905/22_103238.html AIRガジェットで前回終了時の設定を復元する方法 http://rontan.sakura.ne.jp/2009/05/tips_air_gadget_position_set/
import flash.display.NativeWindow; import flash.display.Stage; var m:Main = new Main(); this.addChild(m); var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions(); //newOptions.type = NativeWindowType.UTILITY; var newWindow:NativeWindow = new NativeWindow(newOptions); //newWindow.stage.stageWidth = 400; //newWindow.stage.stageHeight = 300; //newWindow.stageWidth = 300; //newWindow.stageHeight = 200; //newWindow.width = 300; //newWindow.height = 200; newWindow.stage.scaleMode = StageScaleMode.NO_SCALE; trace(newWindow.stage.scaleMode); newWindow.stage.stageWidth = 300; newWindow.stage.stageHeight = 200; /* var newStage:Stage = new Stage; newStage.stage.stageWidth = 600; newStage.stage.stageHeight = 400; */ //newWindow.stage = newStage; trace(this.stage.stageWidth); trace(this.stage.stageHeight); //newWindow.stage.scaleMode = StageScaleMode.NO_SCALE; //newWindow.stage.align = StageAlign.TOP_LEFT; newWindow.activate();
/* var m1:Main = new Main(); this.addChild(m1); */ var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions(); newOptions.type = NativeWindowType.UTILITY; var newWindow:NativeWindow = new NativeWindow(newOptions); newWindow.stage.scaleMode = StageScaleMode.NO_SCALE; newWindow.stage.align = StageAlign.TOP_LEFT; newWindow.stage.stageWidth = this.stage.stageWidth; newWindow.stage.stageHeight = this.stage.stageHeight; newWindow.activate(); var m:Main = new Main(); newWindow.stage.addChild(m); m.addEventListener(MouseEvent.CLICK, fl_ClickToExit); function fl_ClickToExit(event:MouseEvent):void { trace('fl_ClickToExit'); NativeApplication.nativeApplication.exit(); } newWindow.addEventListener(Event.CLOSING, fl_CloseWindow); function fl_CloseWindow(event:Event):void { trace('fl_CloseWindow'); NativeApplication.nativeApplication.exit(); } this.stop();
//ウインドウを開く var initOptions:NativeWindowInitOptions = new NativeWindowInitOptions(); initOptions.transparent = true; initOptions.systemChrome = NativeWindowSystemChrome.NONE; initOptions.type = NativeWindowType.LIGHTWEIGHT; var mainWindow:NativeWindow = new NativeWindow(initOptions); mainWindow.stage.scaleMode = StageScaleMode.NO_SCALE; mainWindow.stage.align = StageAlign.TOP_LEFT; mainWindow.stage.stageWidth = this.stage.stageWidth; mainWindow.stage.stageHeight = this.stage.stageHeight; mainWindow.activate(); //メインのMCを配置 var m:Main = new Main(); mainWindow.stage.addChild(m); m.addEventListener(MouseEvent.MOUSE_DOWN, baseClickHandler); function baseClickHandler(event:Event):void { // trace('baseClickHandler'); mainWindow.startMove(); } /* m.addEventListener(MouseEvent.CLICK, fl_ClickToExit); function fl_ClickToExit(event:MouseEvent):void { trace('fl_ClickToExit'); } */
//終了処理 m.doubleClickEnabled = true; m.addEventListener(MouseEvent.DOUBLE_CLICK, fl_DoubleClickToExit); function fl_DoubleClickToExit(event:MouseEvent):void { trace('fl_DoubleClickToExit'); NativeApplication.nativeApplication.exit(); } mainWindow.addEventListener(Event.CLOSING, fl_CloseWindow); function fl_CloseWindow(event:Event):void { trace('fl_CloseWindow'); NativeApplication.nativeApplication.exit(); } this.stop();