大家看到 碰到 mx_internal 的时候,可能都会有些疑惑,脑袋中的第一个想法就是这个 mx_internal 是干什么用的呢?
Adobe的官方解释如下:mx_internal is a namespace used by the Flex framework to partition out functions and properties that may change in future releases of the Flex SDK.
相信大家都能看懂,意思就是说mx_internal 是一个命名空间 用在Flex框架的[color=red]部分[/color]方法和属性前面,这个部分怎么理解呢,“部分”就是说 在后期(新版本)推出的Flex框架可能需要变更的属性 和方法 。所以一般就是说,不推荐你使用这些方法和属性,但是如果你一定要是使用这些方法 和属性,就必须 添加 use namespace mx_internal; 这段代码。
You can access properties and functions in this namespace as shown below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="myFunction()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.Text;
import mx.core.mx_internal;
use namespace mx_internal;
private function myFunction():void
{
// 如果不加use namespace mx_internal;那么txt.是不会
//有styleSheet这个属性的。
Alert.show(String(txt.styleSheet));
}
]]>
</mx:Script>
<mx:Text id="txt"/>
</mx:Application>
Note: Be aware that properties or functions defined may change in future versions of SDK.
注:第一次发帖,讲的比较粗糙,说的不对的地方,还请指正,谢谢!!
Adobe的官方解释如下:mx_internal is a namespace used by the Flex framework to partition out functions and properties that may change in future releases of the Flex SDK.
相信大家都能看懂,意思就是说mx_internal 是一个命名空间 用在Flex框架的[color=red]部分[/color]方法和属性前面,这个部分怎么理解呢,“部分”就是说 在后期(新版本)推出的Flex框架可能需要变更的属性 和方法 。所以一般就是说,不推荐你使用这些方法和属性,但是如果你一定要是使用这些方法 和属性,就必须 添加 use namespace mx_internal; 这段代码。
You can access properties and functions in this namespace as shown below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="myFunction()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.Text;
import mx.core.mx_internal;
use namespace mx_internal;
private function myFunction():void
{
// 如果不加use namespace mx_internal;那么txt.是不会
//有styleSheet这个属性的。
Alert.show(String(txt.styleSheet));
}
]]>
</mx:Script>
<mx:Text id="txt"/>
</mx:Application>
Note: Be aware that properties or functions defined may change in future versions of SDK.
注:第一次发帖,讲的比较粗糙,说的不对的地方,还请指正,谢谢!!