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

常用的Flex代码总结

常用的Flex代码总结
1.刷新浏览器

  navigateToURL(new URLRequest("javascript:location.reload();"),"_self")

  2.关闭浏览器

  navigateToURL(new URLRequest("javascript:window.close()"),"_self");

  3.打开一个新浏览器窗口

  navigateToURL(new URLRequest('http://ntt.cc'), '_blank');

  4.复制一个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 );

  5.复制内容到系统剪贴板

  System.setClipboard(strContent);

  6.清除子串左侧空格

  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);

}

7.设置Alert 窗口的背景为透明

  Alert

  {

  modalTransparency:0.0;

  modalTransparencyBlur:0;

  }

  8.获取取随机颜色

  lbl.setStyle('color', 0xffffff*Math.random());

  9.获取数据类型

  getQualifiedClassName(data)

  10.字符串右侧空格清除

  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);

  }

  11.清除字串左右的空格

  public function Trim(s : String):String

  {

  return LTrim(RTrim(s));

  }

12.生成随机字符串.

  private function GenerateCheckCo


相关文档:

flex时序图示例

<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>

import mx.collections.ArrayCollection;
......

Flex 右键菜单

MXML:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="20" initialize="doinit()"   mouseOver="getMouseTarget(event)">
 <mx:ArrayCollection id="dgArray">
  <mx:Object pid="1" name="秦始皇" time="秦" />
&nbs ......

Flex 本地安全策略问题

今天在做项目的时候遇到了一个问题,访问xml文件就是成功不了。看了看以前写过的代码都可以,而这个项目中为什么就不行了呢?仔细查看了目录,是百思不得其解啊。
错误信息:*** Security Sandbox Violation ***
Connection to file:///C|/loading.swf halted - not permitted from xxxx/data.xml。这个xml是在工程里面sr ......

flex 客户端分页

Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:file="file.*">
<mx:Script>
<!--[CDATA[
import simPager.PagerEvent;
import mx.collections.ArrayCollection;
[Bindable]
priv ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号