I've been struggling with the PopUpButton for a day now.. Just trying to move the popup location. Since I can't get moving the PopUpButton into my directory and have it find the icons, I'm attempting to subclass PopUpButton.
Some of the methods in PopUpButton are defined as mx_internal. I cannot seem to access the methods during runtime. I get an error:
Main Thread (Suspended: TypeError: Error #1006: value is not a function.)
I can compile the code, prefixing the specific function with "mx_internal."
Here is the code:
use namespace mx_internal;
public class ViewControl extends PopUpButton
public function ViewControl(state:String = ViewSelectorState.TILE, value:Number=0):void
/* Add the popup */
_renderer = new ViewSelectorRenderer();
super.popUp = _renderer;
/* override the click */
override protected function clickHandler(event:MouseEvent):void
I haven't yet had the need to use a mx_internal, however there are 2 differences that may be a problem which I saw between your code and the link below:
Those differences are:
-import mx.core.mx_internal; //this import statement should appear be last. So, for some reason I assume the author is saying to have that listed last, out of all of your imports.
-use namespace mx_internal; This line is nested between the class brackets. Yours is nested in the package brackets.
Does that help?
Thanks for the link, unfortunately it didn't work.. I had found this reference last night and tried several permutations of it. They allowed me to compile, but not execute. I had attempted this a while ago with vars and that did seem to work. For some reason, the runtime doesn't think its a function.