本文来自:http://keren.iteye.com/blog/372977

转:http://xinsync.xju.edu.cn/index.php/archives/1930

What is mx_internal?
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12212
什么是mx_internal? 
引用:http://life.neophi.com/danielr/2007/05/mx_internal.html的话:
有时候你想改变一个Flex组件的行为, 但是它藏在私有方法或者私有变量后面, 所以你不能取得它
许多Flex framework里的组件有些方法和属性被标记为mx_internal命名空间,这样你就可以, 访问藏在私有方法或者私有变量后面的东东了。这东东官方说是会随时变动的,请注意使用!
使用mx_internal的例子:
下面的例子,用mx_internal来设置限制输入:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical”>
<mx:Script>
<![CDATA[
import mx.core.mx_internal;//注意这里
use namespace mx_internal;
private function setupStepper():void{
stepper.mx_internal::inputField.restrict = "0-9";
}
]]>
</mx:Script>
<mx:NumericStepper id=”stepper” creationComplete=”setupStepper();”/>
</mx:Application>
下面是我的工程中截取的代码,如不能选择对话框中的文本
alert.(mx_internal::alertForm).(mx_internal::textField).selectable = false; // 用户不能选择提示文本
本文来源于 冰山上的播客 http://xinsync.xju.edu.cn , 原文地址:http://xinsync.xju.edu.cn/index.php/archives/1930
posted on 2011-10-23 16:32  夏麦宜  阅读(1082)  评论(0编辑  收藏  举报