开发者

What is $height in Flex 3.x?

开发者_StackOverflow中文版

When debugging some container sizes (namely, HBox) in Flex (v. 3.5), I noticed a variable "$height" in the Variables list.

Does anyone know what this variable is? It's marked as protected, but I don't believe I can access it in a child class.

I've noticed it sometimes gets a different value than "height" and "_height". Does anyone know why this is and what it means for how a component is drawn?


The full mx framework source is available in your sdk directory here:

\..\sdks\3.3.0\frameworks\projects\framework\src

The private documentation says.

 /*
 *  This property allows access to the Player's native implementation
 *  of the 'height' property, which can be useful since components
 *  can override 'height' and thereby hide the native implementation.
 *  Note that this "base property" is final and cannot be overridden,
 *  so you can count on it to reflect what is happening at the player level.
 */

It's marked with mx_internal so you need to declare use namespace mx_internal; to get access to it in your own class.


Flex overrides a lot of methods in it's custom objects, such as FlexSprite.

In their internal code base, they often declare new methods that are marked 'final' and super() to the default method implementation. These final methods start with '$' so that they are easily identifiable.

Another example you would see is '$addChild', flex has custom addChild functionality, but uses the original implementation internally through the '$addChild' method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜