开发者

Ambigous reference when using the CodeBehind pattern

I'm getting the ambiguous reference error when trying to bind properties. Here's the code:

MXML

<?xml version="1.0" encoding="utf-8"?>

<custom:Test
    xmlns:mx        = "library://ns.adobe.com/flex/mx"
    xmlns:fx        = "http://ns.adobe.com/mxml/2009" 
    xmlns:custom    = "CodeBehind.*">

    &开发者_Go百科lt;mx:TextInput id = "foo" text = "foo!">
    </mx:TextInput>

    <mx:TextInput id = "bar" text = "{foo}">
    </mx:TextInput>

</custom:Test>

CodeBehind

package CodeBehind
{
    import mx.containers.Panel;

    public class Test extends Panel
    {

    }
}

Here's the error itself:

/Front/Test.mxml(-1):  Error: Ambiguous reference to Test.

<?xml version="1.0" encoding="utf-8"?>

Strangely enough, it doesn't even mention the binded property...


Okay, so I've managed to solve it. I renamed Front/Test.mxml to Front/TestDisplay.mxml and that did the trick - no more ambiguous reference.


I could not reproduce the error. Everything compiled in FB4.
I assumed the structure was

Front
-> | Test.mxml
CodeBehind
-> | Test.as

Possible choices :

  • Check your folder/package structure
  • Are there any other files with Test as the name or auto-generated files?
  • I have seen others had bad builds with their Flex Builder so try cleaning the project set.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜