Flex 组件主要包含:大小 Size、事件Events 风格Styles 效果Effects 皮肤Skins等
<?xml version="1.0"?>
<!-- components\ButtonApp.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
public function handleClick():void {
text1.text="Thanks for the click!";
}
]]>
</fx:Script>
<s:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
<s:TextArea id="text1"/>
</s:Application>
有网页和js基础的应能看懂,上面是添加了一个按钮和一个文本域,通过点击,调用handleClick函数,
在id为text1的文本域上显示"Thanks for the click!";