Web Design Resources & Tutorials to help you design the best website!

The error is 1000: Ambiguous reference to setStyle. It took me a while to find a solution, It happens when you are trying to set a style, for example: setStyle(“w”,50) in Flex and at the same time you are using the mx_internal namespace. For Example
use namespace mx_internal; private function dummyTest():void { var mainSelector:CSSStyleDeclaration = StyleManager.getStyleDeclaration("VadexTabBar"); if(!mainSelector) { mainSelector = new CSSStyleDeclaration(); } mainSelector.defaultFactory=function():void { } mainSelector.setStyle("tabWidth",500); StyleManager.setStyleDeclaration("VadexTabBar",mainSelector,false); }
Solution to the Problem:
Instead of opening all the namespace and having “use namespace mx_internal” on top, just selectively open up the namespace “mx_internal::property”, and don’t include use namespace mx_internal on top.For example
private function set navItemFactoryInternal(value:Class):void { mx_internal::navItemFactory =new ClassFactory(value); }

3 Responses to 1000: Ambiguous reference to setStyle
Software By Richard » Stylesheets and mx_internal
October 10th, 2008 at 1:46 pm
[...] more details can be found here. [...]
PeZ
December 6th, 2008 at 11:52 am
It saved me a lot of time I guess. Thanks!
Chris
March 23rd, 2009 at 8:24 pm
Nice catch, that would have taken me a long while to figure out.
Thanks.