Flexでビルトイン右クリックメニューを表示・非表示

by genms forked from Flex動作テストテンプレート (diff: 16)
♥0 | Line 23 | Modified 2009-09-10 02:15:31 | MIT License
play

ActionScript3 source code

/**
 * Copyright genms ( http://wonderfl.net/user/genms )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9G0L
 */

<?xml version="1.0" encoding="utf-8"?>
<!-- forked from genms's Flex動作テストテンプレート -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
	<![CDATA[
		import mx.managers.SystemManager;
		
		public function onBtnClick(event:Event):void {
			var contextMenu : ContextMenu = new ContextMenu();

			contextMenu.hideBuiltInItems();
			contextMenu.builtInItems.zoom = true; //拡大、縮小、100%表示、すべて表示
			contextMenu.builtInItems.quality = true; //画質
			contextMenu.builtInItems.play = true; //再生
			contextMenu.builtInItems.loop = true; //ループ再生
			contextMenu.builtInItems.rewind = true; //巻き戻し
			contextMenu.builtInItems.forwardAndBack = true; //先送り、戻る
			contextMenu.builtInItems.print = true; //プリント

			SystemManager(systemManager).contextMenu = contextMenu;
			this.contextMenu = contextMenu;
		}
	]]>
	</mx:Script>
	<mx:Button id="btn" label="click" click="onBtnClick(event);"/>
</mx:Application>