目次

MXML

Adobe Flex におけるアプリケーション記述言語。

下記は Flash Builder 4 beta 2 で AIR アプリケーションを作ってみた例。

Visual Basic や Delphi の感覚で(といっても若い人にはわからないか。。)「ボタンを押すと文字が出力される」アプリケーションを作れる。

「アラートボックスの表示」「テキストボックスへの文字列の代入」「デバッグ用コンソールへの文字出力」を行っている。

"import mx.controls.Alert;" の部分は入力した。基本的にXMLの部分は Flash Builder が生成している。

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
   xmlns:s="library://ns.adobe.com/flex/spark" 
   xmlns:mx="library://ns.adobe.com/flex/halo" width="366" height="158">
	<fx:Script>
		<![CDATA[
			import flash.events.MouseEvent;
			import mx.controls.Alert;
			protected function testButtonClickHandler(event:MouseEvent):void
			{
				helloText.text = "hello";
				Alert.show("hello");
				trace("hello");
			}
		]]>
	</fx:Script>
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<s:Button x="10" y="54" label="ボタン" id="testButton" click="testButtonClickHandler(event)"/>
	<s:TextInput x="84" y="55" id="helloText"/>
</s:WindowedApplication>

実行例

E4X

ECMAScript for XML

http://help.adobe.com/ja_JP/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e72.html

Adobe AIR でマイク入力

http://www.adobe.com/devnet/air/flex/articles/using_mic_api.html