错误1120:访问未定义的属性 [英] Error 1120: Access of undefined property
问题描述
我在主文件中定义了一个< mx:Script>
<$ p
$ {
$'$'$'$'$'''''''''''''''''''''''' :'RAL1013','hex':'E8E4CD'},
{'prx':'am','nmb':'Amarillo','ral':'RAL1005','hex':'C79E03' },
{'prx':'gr','nmb':'Gris Perla','ral':'RAL7045','hex':'8E939E'}
]);
我可以在很多地方将它用作dataProvider,但不在这里:
< mx:TileList dataProvider ={dpCols}>
< mx:itemRenderer>
< mx:Component>
< mx:Box backgroundColor ={int('0x'+ data.hex)}
height =64width =72>
< mx:Label text ={data.ral}textAlign =centerwidth =100%/>
< / mx:Box>
< / mx:Component>
< / mx:itemRenderer>
< / mx:TileList>
此TileList位于< radg:RaDG>
(我的AdvancedDataGrid的子类),< radg:columns>
,< mx:AdvancedDataGridColumn>
, < mx:itemEditor>
和< mx:Component>
。如果我把它放在外面,那就行了。但是我需要把它放在itemEditor中。
我应该如何引用 dpCols
然后呢? (或者我怎么解决这个错误?)
谢谢! 解决方案
p>您需要 用法: I have a I can use it as a dataProvider in many places, but not here: This TileList is within a How should I refer to Thanks! You need If you're getting particularly tricky with nesting, you may need to use Usage:
这篇关于错误1120:访问未定义的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! outerDocument $ c $因为您位于
< mx:Component>
标记内。请参阅此Adobe中的使用组件标记部分文档页面或此 SO问题。如果你在嵌套方面变得特别棘手,你可能需要使用 parentDocument
,但听起来像 outerDocument
应该适用于您的情况(只有一个嵌套< mx:Component>
标签)。 b
< mx:TileList dataProvider ={outerDocument.dpCols}/> ;
<mx:Script>
on the main file, where I define this:[Bindable]
private var dpCols:ArrayCollection = new ArrayCollection([
{'prx':'bl', 'nmb':'Blanco', 'ral':'RAL1013', 'hex':'E8E4CD'},
{'prx':'am', 'nmb':'Amarillo', 'ral':'RAL1005', 'hex':'C79E03'},
{'prx':'gr', 'nmb':'Gris Perla', 'ral':'RAL7045', 'hex':'8E939E'}
]);
<mx:TileList dataProvider="{dpCols}">
<mx:itemRenderer>
<mx:Component>
<mx:Box backgroundColor="{int('0x' + data.hex)}"
height="64" width="72">
<mx:Label text="{data.ral}" textAlign="center" width="100%"/>
<mx:Label text="{data.nmb}" textAlign="center" width="100%"/>
</mx:Box>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
<radg:RaDG>
(my subclass for AdvancedDataGrid), <radg:columns>
, <mx:AdvancedDataGridColumn>
, <mx:itemEditor>
and <mx:Component>
. If I put it outside, it just works. But I need it to put it has the itemEditor.dpCols
then? (or how can I solve this error?)outerDocument
, since you're inside the <mx:Component>
tag. See the "Using the Component Tag" section in this Adobe docs page or this SO question.parentDocument
instead, but it sounds like outerDocument
should work in your case (only one nesting of <mx:Component>
tags).<mx:TileList dataProvider="{outerDocument.dpCols}" />