MXML は,ウィンドウの構成を記述する。こんな感じ。
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
title="Hello AIR">
<mx:Script>
<![CDATA[
private function hello():void {
myLabel.text = "Hello AIR!";
}
]]>
</mx:Script>
<mx:Label id="myLabel" horizontalCenter="0" verticalCenter="0"/>
<mx:Button id="myButton" label="click" horizontalCenter="0" verticalCenter="20" c lick="hello();"/>
</mx:WindowedApplication>
ルートエレメントは WindowedApplication で,これがウィンドウ全体を表す。この例では,他に Label と Button が配置されている。
配置できるのはコントロールとかコンテナとか呼ばれるもの。実体は ActionScript のクラスで,パッケージにまとまっている。わかりやすい一覧表みたいなものは見つからないんだけど,リファレンスのこのあたりに情報がある。
- mx:Controls パッケージ
- mx:COntainers パッケージ