Tag Archives: ActionScript

Flex Int转String

打印ABCD:

            	for(var i:int = 65; i < 69; i++) {
            		trace(String.fromCharCode(i));
            	}

结果:

A

B

C

D

Posted in ActionScript | Tagged | Leave a comment

Flex: 通过监听Event实现UI组件的Validation

textInputScore.addEventListener(Event.CHANGE, onTextInputScoreChange); // 监听Change事件
// 检测成绩输入是否有效: 1. 必须为Number; 2. 必须小于最高分

//if(isNaN(parseFloat

More…

Posted in ActionScript | Tagged , | Leave a comment

Flex中的as与显示转换 对比

在As中, 可以使用as与显示转换两种方式进行转换
如下:
var str:String = "10";
trace(str as int);
trace(int(str));
输出: null 10

More…

Posted in ActionScript | Tagged , | Leave a comment

Flex: Tree如何展开/关闭一个节点, 并选中其孩子? 如何关闭所有的节点?

_treeOUs.expandChildrenOf(currentOU, true); // 展开目录

_treeOUs.selectedItem = ou; //选定孩子

_treeOUs.openItems = []; // 关闭所有节点;
expandChildrenOf(item:Ob

More…

Posted in ActionScript | Tagged , | Leave a comment

AIR: 通过监听ContextMenuEvent.MENU_SELECT事件 动态改变菜单内容

某Tree上的menu
_menu = new NativeMenu();
_menuAddTopOU = new NativeMenuItem("Add Top OU");
_menuAdd = new NativeMenuItem("Selcet one

More…

Posted in ActionScript | Tagged , , , , , | Leave a comment