Flex2 and namespaces extending components

Primary Homework Help Co Uk Victorians I took 2 hours to find a solution for that and I decided to blog it.. I was creating my new Flex2 component extending the UIComponent class and I need to define new custom styles for my own component… Education Assignment Ok, i opened the “create and extend components” PDF guide and found that I need to put this code to accomplish it:

private static function classConstruct():Boolean
{
if (!StyleManager.getStyleDeclaration("ResizeManager"))
{
var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();
newStyleDeclaration.setStyle("boxSize", 4);
StyleManager.setStyleDeclaration("ResizeManager", newStyleDeclaration, true);
}
return true;
}

Order Dissertation Umi That’s all, but at this time the compiler die with that error message “1000: Riferimento ambiguo a setStyle”, which in english should be: “ 1000: Ambiguous reference to setStyle“.
I google for some time but without finding a solution, then I discovered the problem. I was using in my component the mx_internal namespace, that was the problem. Once changed namespace everything was ok.

  • Ward Ruth

    Thank you for this! You just saved me probably hours of frustration. I’m doing pretty much the same thing you are, extending UIComponent. I needed the mx_internal namespace because I’m calling CursorManager.registerToUseBusyCursor(), etc. So I just ditched the use namespace declaration and instead used the explicit mx_internal::CursorManager.registerToUseBusyCursor().

  • charles stephens

    I also had the same problem, if you need to use ‘mx_internal’ name space then call ‘setStyle’ explicitly using that name space:
    private static function classConstruct():Boolean
    {
    if (!StyleManager.getStyleDeclaration(“ResizeManager”))
    {
    var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();
    newStyleDeclaration.mx_internal::setStyle(“boxSize”, 4);
    StyleManager.setStyleDeclaration(“ResizeManager”, newStyleDeclaration, true);
    }
    return true;
    }

    Help With Essay Uk
  • Jacob Wright

    I found that I could still use mx_internal (because I needed to) and still use setStyle by specifying the namespace in the call:
    newStyleDeclaration.public::setStyle(“boxSize”, 4);