views:

55

answers:

2

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?

A: 

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.

Tyler Egeto
+2  A: 

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.

Sam
Y'know, it never occurred to me to look in the source :) Thanks!
bedwyr