Flex Embed png,需要元数据
这是我代码的一部分,
[Embed(source='dmr/images/icones/icnPresenceInline.png')];
[Bindable]
private var presentAuBureau:Class;
[Embed(source="dmr/images/icones/icnVacancesInline.png")];
[Bindable]
private var enCongeAujourdhui:Class;
override public function set data (value:Object):void {
super.data = value
if(data.onLeaveToday == true) {
etat.source = new presentAuBureau();
etat.toolTip = "Présent au bureau";
}
if(data.presence == '1') {
etat.source = new enCongeAujourdhui();
etat.toolTip = "En congé aujourd'hui";
}
}
它无法编译..“元数据需要关联的定义”的问题。我找不到缺少的内容...我在谷歌上搜索的所有示例在某种程度上都是相同的代码。
请问有什么提示吗? ?
this is a part of my code
[Embed(source='dmr/images/icones/icnPresenceInline.png')];
[Bindable]
private var presentAuBureau:Class;
[Embed(source="dmr/images/icones/icnVacancesInline.png")];
[Bindable]
private var enCongeAujourdhui:Class;
override public function set data (value:Object):void {
super.data = value
if(data.onLeaveToday == true) {
etat.source = new presentAuBureau();
etat.toolTip = "Présent au bureau";
}
if(data.presence == '1') {
etat.source = new enCongeAujourdhui();
etat.toolTip = "En congé aujourd'hui";
}
}
It doesn't compile .. trouble with "meta data requires an associated definition. I can't find what's missing ... all examples i've googled are somehow the same code.
Any hint please ??
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
删除
[Embed]
元数据标记后的;
:[ ]
元数据标记是描述以下对象的描述符。在本例中是私有变量。因此它们属于在一起,因此不以分号分隔。此外,在使用对象时,您应该将它们转换为正确的类型。这在您的显式情况下并不重要(因为您将对象分配给通用对象),但以后可能会成为问题:
Remove the
;
after the[Embed]
meta data tags:The
[ ]
meta data tags are descriptors that describe the following object. In this case the private variables. So they belong together and as such are not separated by a semicolon.Also you should cast your objects to the correct types when using them. This doesn't matter in your explicit case (as you assign the objects to a generic Object), but it might become a problem later:
首先尝试在相对路径的开头使用 [Embed(source='/dmr/images/icones/icnPresenceInline.png')] 并带有 /
不要使用 etat.source = new presentAuBureau();
而是使用
etat.source = presentAuBureau;
try first to use [Embed(source='/dmr/images/icones/icnPresenceInline.png')] with / at the beginning of the relative path
Do not use etat.source = new presentAuBureau();
Instead use
etat.source = presentAuBureau;
尝试从主菜单中选择“项目”>“清理”。
确保路径
dmr/images/icones/icnVacancesInline.png
正确。使用其他图像进行测试,看看它们是否会导致相同的问题。
Try Project>Clean from the main menu.
Make sure the path
dmr/images/icones/icnVacancesInline.png
is correct.Test with other images see if they cause the same problem.