• Flex显示时间


    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
    	
       <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:Text id="clock" text="" creationComplete="this.init()" height="20" color="#FFFFFF"/>
       <mx:Text id="date" text="" creationComplete="this.init()" height="20" color="#FFFFFF"/>
       	
    </mx:HBox>
    
  • 相关阅读:
    Django项目总结:Model高级
    Django项目总结:Response和Cookie
    数据库:索引
    数据库:视图
    数据库:约束
    MySQL:常用命令
    MySQL:安装和连接
    时间戳和正则表达式
    Java 类的概念与使用
    JAVA复习题
  • 原文地址:https://www.cnblogs.com/frostbelt/p/1978278.html
Copyright © 2020-2023  润新知