使用 CodeBehind 模式时的引用不明确
尝试绑定属性时出现不明确的引用错误。这是代码:
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.*">
<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
{
}
}
这是错误本身:
/Front/Test.mxml(-1): Error: Ambiguous reference to Test.
<?xml version="1.0" encoding="utf-8"?>
奇怪的是,它甚至没有提到绑定属性......
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.*">
<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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,所以我已经成功解决了这个问题。我将 Front/Test.mxml 重命名为 Front/TestDisplay.mxml,这样就成功了 - 不再有模糊的引用。
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.
我无法重现该错误。一切都在 FB4 中编译。
我假设结构是
Front
-> | test.mxml
CodeBehind
-> | test。
可能的选择:
test
作为名称或自动生成的文件?I could not reproduce the error. Everything compiled in FB4.
I assumed the structure was
Front
-> | Test.mxml
CodeBehind
-> | Test.as
Possible choices :
Test
as the name or auto-generated files?