私はカスタムItemRendererを持つTileListを持っていて、各項目は、dataProviderから受け取ったデータからextgractするイメージを表示します。奇妙なことは、私は、なぜ、いくつかのアイテムが、データボックにはないが別のアイテムデータにあるショーイメージであるということを知りません。自分のデータからイメージURLを抽出している場合、別のアイテムからイメージURLを取得する方法がわかりません。私は、ツールのヒントを使用してイメージのURLとアイテムのデータを表示し、URLがそのデータにないことを確認しました。ここでフレックス:リスト内の他のアイテムからデータを取り出すListItem?
は、私が使用しています一時XMLです:
<data>
<bs item_id="1">
<variation price="300" month="JAN" stone="Garnet" image="<?=$img_dir?>jan.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="400" month="FEB" stone="Garnet" image="<?=$img_dir?>feb.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="550" month="MAR" stone="Garnet" image="<?=$img_dir?>march.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="625" month="APR" stone="Garnet" image="<?=$img_dir?>april.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
</bs>
<bs item_id="2">
<variation price="300" month="JAN" stone="Garnet" image="<?=$img_dir?>jan.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="400" month="FEB" stone="Garnet" image="<?=$img_dir?>feb.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="550" month="MAR" stone="Garnet" image="<?=$img_dir?>march.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="625" month="APR" stone="Garnet" image="<?=$img_dir?>april.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
</bs>
<bs item_id="3">
<variation price="300" month="JAN" stone="Garnet" image="<?=$img_dir?>jan.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="400" month="FEB" stone="Garnet" image="<?=$img_dir?>feb.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="550" month="MAR" stone="Garnet" image="<?=$img_dir?>march.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="625" month="APR" stone="Garnet" image="<?=$img_dir?>april.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
</bs>
<bs item_id="4">
<variation price="300" month="JAN" stone="Garnet" image="<?=$img_dir?>PE105-BT.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="400" month="FEB" stone="Garnet" image="<?=$img_dir?>PE105-EM.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="550" month="MAR" stone="Garnet" image="<?=$img_dir?>PE105-OP.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
<variation price="625" month="APR" stone="Garnet" image="<?=$img_dir?>PE105.png" style="xsdfcSD" gold_color="Yellow" gold_carat="10"/>
</bs>
</data>
各項目は< BS>ブロックを取得します。
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="150" height="150" xmlns:local="*">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var _randomIndex:uint;
private var _indexSet:Boolean;
private function getRandomImage():String
{
if (!_indexSet)
{
var maxIndex:uint = data.children().length();
_randomIndex = Math.floor(Math.random()*maxIndex);
_indexSet = true;
}
return data.children()[_randomIndex][email protected];
}
]]>
</mx:Script>
<local:LoadingImage id="tn" toolTip="{tn.source+'\n\n'+data}" source="{getRandomImage()}" width="150" height="150"/>
</mx:Canvas>
2番目と3番目にのみ第4ブロック内にある画像を示している:(4つの項目)ここで
とItemRenderからのコードです。
誰も私が見ていないことを見ていますか?
ありがとうございます!
バインディングの変更が検出されないためです。参照: http://stackoverflow.com/questions/445313/can-i-bind-a-flex-component-property-to-a-function – an0nym0usc0ward