Flex LogÄ£¿éÈëÃż°À©Õ¹
£¨Ò»£©ÈëÃÅ
Flex¼¯³ÉÒ»¸öLog¿ò¼Ü£¬¿ÉÒÔÍê³ÉºÜ¶àÓÃtrace()×ödebugʱÍê³É²»Á˵ŦÄÜ
Êä³ölogʱ¿ÉÒÔʵÏֵַȼ¶£¨¹²5+1¼¶£©£¬ÓùýÂËÆ÷Ö¸¶¨Êä³öµÄÀ࣬ÒÔ¼°Êä³ö·½Ê½£¨Ä¬ÈÏΪtrace£©
ÐèÒªÓõ½µÄÀà
¸ÃÀàλÓÚmx.logging°üÖУ¬
¹²ÐèÒªÈý¸öÀàºÍÒ»¸ö½Ó¿Ú
mx.logging.Log – Ö÷À࣬Óм¸¸ö¾²Ì¬·½·¨£¬Ìí¼Ó/ÒƳýTraceTargetºÍ»ñÈ¡ILogger
mx.logging.LogEventLevel – ¶¨ÒåÁËlogµÈ¼¶µÄ³£Á¿
mx.logging.targets.TraceTarget – loggerÆ÷£¬¶¨ÒålogÊä³öµÈ¼¶£¬¹ýÂËÆ÷ºÍÊä³ö·½Ê½
mx.logging.ILogger – ÓÉLog.getLogger(‘ClassName’)»ñÈ¡µ½µÄLogger·¢ËÍÆ÷
ʹÓò½Öè
1.. н¨TraceTarget
var traceTarget:TraceTarget = new TraceTarget();
traceTarget.filters = ['spark.components.*','myPackage.MyClass']; //´´½¨¹ýÂËÆ÷£¬¿ÉÒÔÖ±½ÓÓÃclassÃû£¬Ò²¿ÉÒÔʹÓÃ*Àà¹ýÂËÕû¸ö°ü
traceTarget.filters = [*]; //ÕâÑùд¹ýÂËÆ÷£¬¾ÍÊÇÊä³öÈ«²¿ÀàÁË
traceTarget.includeDate = true; //Êä³öÐÅÏ¢ÊÇ·ñ°üº¬ÈÕÆÚ
traceTarget.includeTime = true; //Êä³öÐÅÏ¢ÊÇ·ñ°üº¬Ê±¼ä
traceTarget.includeLevel = true; //Êä³öÐÅÏ¢ÊÇ·ñ°üº¬µÈ¼¶
traceTarget.includeCategory = true; //Êä³öÐÅÏ¢ÊÇ·ñ°üº¬classÃû
traceTarget.level = LogEventLevel.INFO; //É趨Êä³öµÄµÈ¼¶
LogµÈ¼¶ËµÃ÷
log¹²·ÖΪ5¼¶ºÍALL
·Ö±ðÊÇALL(0), DEBUG(2), INFO(4), WARN(6), ERROR(8), FATAL(1000)
ÿ¸öµÈ¼¶ÔÚÊä³öʱ¶¼°üº¬ÁË×ÔÉí¼°ºóÐøµÈ¼¶µÄÐÅÏ¢
¼´µ±°ÑµÈ¼¶É趨ΪINFOʱ£¬INFO, WARN, ERROR, FATALÖеÄÐÅÏ¢¶¼»á±»Êä³ö£¬¶øÅÅÔÚINFOÇ°ÃæµÄDEBUGÔò²»»á±»Êä³ö
2. ½«TraceTargetÌí¼Óµ½LogÖÐ
Log.addTarget(traceTarget);//¿ÉÒÔaddTarget¶à¸öTraceTarget£¬ÒÔ±ãÓÚÓò»Í¬·½Ê½¸ú×Ù²»Í¬µÄÐÅÏ¢
//ÒƳýµÄ·½·¨£ºLog.removeTarget(traceTarget);
»ñÈ¡ILogger²¢Êä³ö
var info:ILogger = Log.getLogger(‘myPackage.MyClass’); //»ñÈ¡ILogger£¬getLoggerµÄ²ÎÊýÓÃÓÚ¹ýÂËÆ÷ʹÓÃ
info.info(‘trace log massege’); //Êä³öÖ¸¶¨µÈ¼¶µÄlogÐÅÏ¢
info.debug(‘trace log massege‘,’trace log massege2′); //²ÎÊý¿ÉÒÔÈÎÒâ¸ö£¬Óëtrace()Ïàͬ
info.error(‘trace log massege‘);
info.warn(‘trace log massege‘);
info.fatal(‘trace log massege‘);
info.log(LogEventLevel.INFO,&rs
Ïà¹ØÎĵµ£º
Flex4Öж¯Ì¬¼ÓÔØCSSÎļþµÄ·½Ê½ÒѾºÍFlex3ÓÐÁËÒ»¶¨µÄÇø±ð
Ö÷Òª²½ÖèÈçÏ£º
1.±àд²»Í¬µÄCSSÎļþ
¼ûºóÎÄ
2.½«CSSÎļþ±àÒë³ÉSWFÎļþ
ÔÚFlashBuilderÖÐÓÒ¼üCSSÎļþ£¬Ñ¡ÔñCompile CSS to SWF£¬
Õâʱbin-debugĿ¼ÏµĶÔӦλÖþͻáÉú³ÉÒ»¸öÓëCSSͬÃûµÄSWFÎļþ¡£
Ñ¡Öкó¸ÃÑ¡ÏîÇ°»áÓй´£¬Ö®ºóÖ»ÒªÐÞ¸ÄÁËCSSÎļþ£¬¾Í»á×Ô¶¯±àÒ ......
×î½üÔÚÑо¿flex¼¼Êõ£¬flexºÍflashµÄ½»»¥£¬flexºÍJavaµÄͨÐÅ¡£Ï±ßÊÇÒ»¸öflex¿ØÖÆswfÎļþÖÐÔª¼þµÄ·¶Àý£¬¸Õ½Ó´¥flex£¬ÈçÓв»¶ÔµÄµØ·½£¬´ó¼Ò¶àÌáÒâ¼û¡£
mxmlÎļþ£º
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
&n ......
ÔÎĵØÖ·£ºhttp://blog.163.com/to_yht/blog/static/1227257742009741359326/
µ±³ÌÐò×öÍêºó£¬ÄãÊÇ·ñ»¹ÔÚΪÀÏÌ×µÄflex×é¼þĬÈÏЧ¹û·¢³î£¿ÊÇ·ñ»¹ÔÚΪÔõÑùÉèÖÃ×Ô¼ºµÄƤ·ô浡£ÄÇôÕâЩ¿ÉÄÜÊÇÄãÐèÒªµÄ¡£
Ò» ³¬¿áƤ·ôÖ÷ÌâÍƼö£º
1£® kingnarestyle:
ÏÂÔصØÖ·£ºhttp://code.google.com/p/kingnarestyle/
2£®Carbo ......
1.java
Java´úÂë
package com;
public class LoginDemo {
public String validate(String username,String password){
&nb ......
ÔÚFlexÓ¦ÓÃÖг£³£ÐèÒªÒÔÒ»¶¨µÄ¸ñʽÀ´ÏÔʾʱ¼ä£¬ÒÔÏÂÊÇÒ»ÖÖ×ö·¨¡£
Ê×ÏÈ´´½¨Ò»¸öDateFormatter ¿Ø¼þ
<mx:DateFormatter id="df" formatString="YYYY-MM-DD JJ:NN:SS"/>
formatString="YYYY-MM-DD JJ:NN:SS"Ö¸¶¨ÁËʱ¼äµÄ¸ñʽΪ2009-6-20 19:02:27£¬ÕâÀï¿ÉÒÔÉèÖóÉ×Ô¼ºÐèÒªµÄ¸ñʽ¡£
È»ºóд¸öº¯Êý
......