flex实例效果图
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="top" applicationComplete="init()">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
[Bindable]
public var dataColl:ArrayCollection=new ArrayCollection();
//ID编号
var k=1;
//联系人对象
var userobj:Object;
//性别默认状态
var sexobj:String="男";
//右键删除菜单
var menucont:ContextMenu;
//初始化行数
var p:int=0;
public function init():void{
menucont=new ContextMenu();
addMenuItems();
}
//添加右键菜单项
public function addMenuItems():void{
var item:ContextMenuItem = new ContextMenuItem("删除");
menucont.customItems.push(item);
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler);
menucont.hideBuiltInItems();
userdata.contextMenu = menucont;
}
//菜单右键事件处理
public function menuItemHandler(event:ContextMenuEvent):void{
var CaptionString:String=event.target.caption;
if(CaptionString=="删除"){
//确定鼠标所在行数
var findex:Number = Math.floor(userdata.contentMouseY/userdata.rowHeight)-1 + userdata.verticalScrollPosition;
if (findex<0 || findex>=userdata.verticalScrollPosition+userdata.rowCount-1) //行号小于0时和大于datagrid行总数时的 错误处理
{
Alert.show("请选择要删除的行","提示");
} else {
p=findex;
dataColl.removeItemAt(p);
Alert.show("删除成功","提示");
}
}
}
public function checkuser(event:MouseEvent):void{
var gname=uname.text;
var gphone=uphone.text;
if(gname!="" && gphone!=""){
dataprovider();
}else{
Alert.show("请输入用户名或电话号码","提示");
}
}
//单选按钮触发事件
public function changsex(event:ItemClickEvent):void{
if(event.currentTarget.selectedValue=="f"){
sexobj= "女";
}else{
sexobj= "男";
}
}
//重置
public function resetvalue(event:MouseEvent):void{
uname.text
相关文档:
中文在线帮助文档:http://livedocs.adobe.com/flex/3_cn/langref/
http://examples.adobe.com/flex3/componentexplorer/explorer.html。
其他网站:
http://bbs.actionscript3.cn
http://www.airia.cn
http://www.anyflex.cn/bbs
http://www.5uflash.com/flex-air
http://www.52ria.com
http:// ......
flash.util.Timer类
flash.util.Timer类允许通过添加时间事件或延时来调用方法。通过Timer构造器创建实例对象,传递一个毫秒数字作为构造参数作为间隔时
间,下面的例子实例化一个Timer对象每个1秒钟发出事件信号:
var timer.Timer = new Timer(1000);
......
1.将flex编译后的程序插入到asp.net页面
flex的最终输出就是一张网页+一个flash(.swf文件)
这么说你明白了吧,其实就是用他生成的网页的方式把那个.swf文件插入到你的asp.net页面就可以了。
假如你的flex3项目名字叫TestApp,最简单直接的办法就是,
把"bin-debug"目录下的:
TestApp.html
TestApp.swf
AC_OETags.js ......
一、国外站点
1.资源类
Adobe Flex 2 Component Explorer: 官方的,展示了各种组件的用法,入门必看。
CFlex:很好的一个Flex资源站点,包括教程,新闻,资源站点…… 只是页面有点杂乱,大家一般看右边那一栏就行了。
FlexBox:一个收集了网上很多开源组件的站点,是进阶学习的好帮手。
FlexLib:也是一 ......
转载自 http://amberoracle.blog.163.com/blog/static/10598633820097262242474/
第一步:写AS类继承mx.validators.Validator ,并导入mx.validators.ValidationResult.
value中存放需要验证的内容
results数组中存放验证后的结果,如果通过验证,数据为空;如果验证失败,数组中是ValidationResult.对象,内含失败 ......