actionScript一些代码
来源:互联网 发布:拳王阿里百度云资源 编辑:程序博客网 时间:2024/04/29 11:33
//弹出对话框
static public function popupOverViewDetail(parent:DisplayObject):void {
var overviewDetail:OverviewDetail=new OverviewDetail();
overviewDetail.showCloseButton=true;
overviewDetail.title="总览";
PopUpManager.addPopUp(overviewDetail,parent,true);
PopUpManager.centerPopUp(overviewDetail);
}
.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }
//格式化流量数值 static public function formatCommonByte(num:Number):String { if(num<1024) { return num.toFixed(3)+" B"; } else if(num>=1024 && num<1024*1024) { var knum:Number=num/1024; return knum.toFixed(3)+" KB"; }else if(num>=1024*1024 && num<1024*1024*1024) { var mnum:Number=num/(1024*1024); return mnum.toFixed(3)+" MB"; }else { var gnum:Number=num/(1024*1024*1024); return gnum.toFixed(3)+" GB"; } }
.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }