<?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" minWidth="955" minHeight="600" initialize="application1_initializeHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.formatters.DateFormatter;
private var timer:Timer;//定义时钟组件,以显示时间
protected function application1_initializeHandler(event:FlexEvent):void
{
this.showTime(null);
this.timer=new Timer(1000);
timer.addEventListener(TimerEvent.TIMER,showTime);
timer.start();
}
//该函数用于实时显示系统当前时间
private function showTime(evt:TimerEvent):void
{
var df:DateFormatter=new DateFormatter();
var now:Date=new Date();
df.formatString="YYYY年MM月DD日 JJ:NN:SS";
this.lblDateTime.text=df.format(now);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<fx:XMLList id="treeData">
<root title="业务操作">
<node title="会员增加"/>
<node title="商品增加"/>
<node title="会员查询"/>
<node title="会员消费"/>
</root>
<root title="决策分析">
<node title="会员信息柱形图"/>
<node title="会员信息折线图"/>
</root>
</fx:XMLList>
</fx:Declarations>
<s:Panel x="166" y="31" width="950" height="521" title="会员管理系统">
<mx:Accordion x="0" y="-1" width="200" height="488">
<s:NavigatorContent label="导航栏" width="100%" height="100%">
<mx:Tree width="100%" height="425" labelField="@title" dataProvider="{treeData}" borderStyle="outset">
</mx:Tree>
</s:NavigatorContent>
</mx:Accordion>
<mx:Accordion x="199" y="0" width="748" height="446">
<s:NavigatorContent label="操作区" width="100%" height="100%">
</s:NavigatorContent>
</mx:Accordion>
<mx:LinkButton x="871" y="-25" label="注销"/>
<mx:LinkButton x="907" y="-24" label="退出"/>
<s:Rect height="40" width="948" x="1" y="447">
<s:fill>
<s:SolidColor color="#e2edf7"/>
</s:fill>
</s:Rect>
<s:Label id="lblDateTime" x="780" y="466" text=""/>
</s:Panel>
</s:Application>
一个很好的flex主页面
最新推荐文章于 2024-03-14 07:45:00 发布