package net.rouden.tvlike{ import flash.desktop.NativeApplication; import flash.display.NativeMenu; import flash.display.NativeMenuItem; import flash.display.Sprite; import flash.events.Event; import flash.filters.DropShadowFilter; import flash.system.Capabilities; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; /** * ... * @author ローデン(http://roudenu.blog61.fc2.com/) */ public class Drawer extends Sprite{ private var tf:TextField; private var menu:NativeMenu; private var exitMenu:NativeMenuItem; public function Drawer(){ addEventListener(Event.ADDED_TO_STAGE, onAppear); } private function onAppear(e:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAppear); tf = new TextField(); var format:TextFormat = new TextFormat("meiryo", 30, 0xFFFFFF, true); tf.defaultTextFormat = format; tf.selectable = false; tf.border = false; tf.autoSize = TextFieldAutoSize.LEFT; tf.text = "アナログ"; tf.alpha = 0.7 tf.filters = [new DropShadowFilter(4, 45, 0, 0.7, 50, 50, 9, 1, false)]; addChild(tf); stage.nativeWindow.width = width+40; stage.nativeWindow.height = height+40; stage.nativeWindow.x = Capabilities.screenResolutionX - stage.nativeWindow.width; stage.nativeWindow.y = 0; tf.x = 40; addMenu(); } private function addMenu():void{ menu = new NativeMenu(); exitMenu = new NativeMenuItem("終了"); menu.addItem(exitMenu); contextMenu = menu; mouseChildren = false; exitMenu.addEventListener(Event.SELECT, exit); } private function exit(e:Event):void{ NativeApplication.nativeApplication.exit(); } } }