易截截图软件、单文件、免安装、纯绿色、仅160KB

用flex如何显示数字时钟

 通过Flex中的Timer可是实现数字时钟的效果,其效果图如下:
实现的代码如下:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
<!--[CDATA[

import mx.formatters.DateFormatter;
import flash.utils.Timer;
import flash.events.TimerEvent;

private function init():void {
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, this.resetNow);
timer.start();
}

private function resetNow(event:TimerEvent):void {

// 获取登录时间和日期
var dateFormatter:DateFormatter = new DateFormatter();
dateFormatter.formatString = "YYYY 年 MM 月 DD 日";
var time:String = new Date().toLocaleTimeString();
var date:String = dateFormatter.format(new Date());
this.date.text = date;
this.clock.text = time;
}

]]-->
</mx:Script>

<mx:Style>
Application {
font-size: 12;
}
</mx:Style>

<mx:Text id="date" text="" creationComplete="this.init()" x="10" y="20" width="150" top="23"/>

<mx:Text id="clock" text="" creationComplete="this.init()" x="180" y="20" width="150" top="23"/>

</mx:Application>


相关文档:

Flex使用弹出窗口为DataGrid添加新数据

经常在Demo中会看到列表,表格等方式来显示数据。当然有时候也需要添加数据到这些列表或者表格中。有很多方式提交,这里展示一个弹出窗口的方式来添加新的数据到DataGrid中。
例子展示:
首先,我们开始建设一个基本的界面结构,一个带有“Notes"标题的Panel,一个DataGrid,以及一个用于提交数据的按钮。
<?xml ......

flex 加载gif图片

 使用到的as3gif,请到Google去下载
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:file="file.*" xmlns:commont="commont.*">
<mx:TitleWindow title="abc" id="ADwindow" width="400" height="283" >
< ......

flex 鼠标悬停离开 控制放大缩小 源码

 
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
">
<mx:Style source="style/style.css"/>
    <mx:Scri ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号