Flex: “1000: Ambiguous reference to variableName.”

05Nov2008

This code:

[Bindable]
private function get deWidth():Number
{
return this.dataProvider.width;
}

public function set deWidth( w:Number ):void
{
this.dataProvider.width = w;
}

.. seems fine, but when using the magic getter you’ll get (heh!) this compiler error “Ambiguous reference to deWidth”.

I’ve found found some blogposts referring to this as a bug. I don’t know if it’s a bug or not, but I know that the cause is that the getter is private and the setter is public - which doesn’t make sense.

So, to fix; either change your setter to private or your getter to public :-)

938 Comments

Leave a comment

Remember my personal information

Notify me of follow-up comments?