Hi All,

I've also tried posting this on the flex support forums in case anyone
frequents there (although they're being painfully slow at the
moment...)

I have a TileList displaying images loaded from  a ByteArray. In MXML
code I have something like

<mx:TileList id="myTileList" dataProvider="{CairngormModel.byteArray}"
itemRenderer="MyItemRenderer" />

MyItemRenderer is just a class that extends mx.controls.Image. The
data setter is overriden,  loading the passed ByteArray into a Loader.

The MXML code above works and renders fine, however I'm trying to do
the equivalent in actionscript, which should go something like this:

> public class MyTileList
> {
>     private myTileList:TileList = new TileList();
>     public function MyTileList()
>     {
>          myTileList.itemRenderer  = new ClassFactory(MyItemRenderer);
>          
> BindingUtils.bindProperty(myTileList,"dataProvider",CairngormModel,"byteArray");
>     }
>     override protected function createChildren():void
>     {
>         addChild(myTileList);
>     }
> }

Yet this doesn't render anything. The debugger indicates the
dataProvider field never changes (is always null). Why isn't the
binding executing?

The alternative approaches I've tried include binding a setter to the
CairngormMode.byteArray, using bindSetter(). This function triggers
when the value changes, so I just set myTileList.dataProvider manually
within the setter. This is followed with a call to
myTileList.invalidateProperties() - still nothing is rendered, even
though the debugger reports the dataProvider as the ByteArray.

Am I missing something simple? Why does the MXML work and not the ActionScript?

Any clues would be much appreciated.

Kind Regards,
Ciarán

Reply via email to