十二个非常有用的Flex函数Source In Flex(转)
来源:互联网 发布:32k单片机 编辑:程序博客网 时间:2024/06/12 00:58
No.1 Copy content to clipboard:
- System.setClipboard(strContent);
No.2 Clone an ArrayCollection: 拷贝
- //dummy solution( well, it works )
- var bar:ArrayCollection = new ArrayCollection();
- for each ( var i:Object in ac ){
- bar.addItem( i );
- }
- // fantastic ! //
- var bar:ListCollectionView = new ListCollectionView( ListCollectionView( ac).list );
No.3 Open URL:打开链接
- navigateToURL(new URLRequest('http://ntt.cc'), '_blank'
No.4 Page reload:
- navigateToURL(new URLRequest("javascript:location.reload();"),"_self")
No.5 Close browse:
- navigateToURL(new URLRequest("javascript:window.close()"),"_self");
No.6 Set the background alpha to transparent on Alert window:
- Alert
- {
- modalTransparency:0.0;
- modalTransparencyBlur:0;
- }
No.7 Set random color:
- lbl.setStyle('color', 0xffffff*Math.random());
No.8 Trim left of white space 去左空格
- public function LTrim(s : String):String
- {
- var i : Number = 0;
- while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) ==10 || s.charCodeAt(i) == 9)
- {
- i++;
- }
- return s.substring(i,s.length);
- }
No.9 Trim right of white space 去右空格
- public function RTrim(s : String):String
- {
- var i : Number = s.length - 1;
- while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) ==10 ||s.charCodeAt(i) == 9)
- {
- i--;
- }
- return s.substring(0,i+1);
- }
No.10 Trim left and right of white space 去左右空格
- public function Trim(s : String):String
- {
- return LTrim(RTrim(s));
- }
No.11 get data type:
- getQualifiedClassName(data)
No.12 Generate check digits
- private function GenerateCheckCode():String
- {
- //init
- var ran:Number;
- var number:Number;
- var code:String;
- var checkCode:String ="";
- //get 4 radom
- for(var i:int=0; i<4; i++)
- {
- ran=Math.random();
- number =Math.round(ran*10000); //get result like 0.1234
- if(number % 2 == 0)
- code = String.fromCharCode(48+(number % 10)); //0's ASCII code is 48
- else
- code = String.fromCharCode(65+(number % 26)) ; // A's ASCII code is 65
- checkCode += code;
- }
- return checkCode;
- }
0 0
- 十二个非常有用的Flex函数Source In Flex(转)
- 12个非常简单,但是非常有用的Flex 函数
- Flex中 12个非常有用函数
- 非常有用的flex代码总结
- 非常有用的Java日期时间操作函数代码一览 | 中文Flex例子
- FLEX中两个非常有用的属性,includeInLayout,clipContent
- FLEX中两个非常有用的属性,includeInLayout,clipContent
- FLEX中两个非常有用的属性,includeInLayout,clipContent
- 15个非常有用的Adobe Flex教程
- 15款非常有用的Adobe Flex教程
- 有用的Flex代码
- Flex - 转:12条有用的flex代码
- Flex 非常实用的资料
- Flex 非常实用的资料
- Flex非常实用的资料
- Flex 非常实用的资料
- 一些有用的flex资源
- 有用的Flex Builder快捷键
- 共阳数码管和共阴数码管用法区别
- poj 2387
- Unity3D - 图形性能优化:角色建模
- java各种集合的线程安全
- getframe
- 十二个非常有用的Flex函数Source In Flex(转)
- php中的session cookie 记住密码基本原理 浏览器退出登录后保持状态
- CocoaPods详解之----使用篇
- KMP 算法之得到next的代码
- 字节码内容理解
- [lcm本质] light oj 1236 Pairs Forming LCM
- 单例模式:为什么要双重检测
- linux配置java环境变量(详细)
- cocoapods 安装和使用