flex4cookbook
需积分: 0 11 浏览量
更新于2011-03-09
1
收藏 4.7MB RAR 举报
pdf文件,书为英文版,内附源码.
<?xml version="1.0" encoding="utf-8"?>
<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"
creationComplete="app_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected var names:Array = ['Leif','Zach','Stacey','Seth','Leonard'];
protected var titles:Array = ['Evangelist','Director',
'Information Architect','Director',
'Creative Director'];
protected function app_creationCompleteHandler(event:FlexEvent):void
{
btn.addEventListener(MouseEvent.CLICK, showNames);
btn.addEventListener(MouseEvent.CLICK, showtitles);
}
protected function showNames(event:MouseEvent):void
{
trace(names.toString());
}
protected function showtitles(event:MouseEvent):void
{
trace(titles.toString());
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:Button id="btn" label="Show Names and Titles"/>
</s:Application>