1000: Ambiguous reference to setStyle

14 Sep
2008
Delicious

flexles2 1000: Ambiguous reference to setStyle
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);
		}
Incoming Search Terms :ambiguous reference to setstyle , flex ambiguous reference to setstyle , 1000: ambiguous reference to , 1000: Ambiguous reference to setStyle , ambiguous reference to , 1000: Ambiguous reference to Vector , setstyle ambigious , flex setstyle error , ClassFactory setStyle , 1000 ambiguous reference to setStyle

Share this story with a friend !
Join SherifAbdou's Rss Feed Stumble This Article! Add this to your Delicious Bookmarks! Digg this story ! Add this story to Reddit ! Tweet This Brush


3 Responses to 1000: Ambiguous reference to setStyle

Avatar

Software By Richard » Stylesheets and mx_internal

October 10th, 2008 at 1:46 pm

[...] more details can be found here. [...]

Avatar

PeZNo Gravatar

December 6th, 2008 at 11:52 am

It saved me a lot of time I guess. Thanks!

Avatar

ChrisNo Gravatar

March 23rd, 2009 at 8:24 pm

Nice catch, that would have taken me a long while to figure out.
Thanks.

Comment Form