[flexcoders] first tile of tilelist does not show up

2009-11-17 Thread mattgarland2000
I have a component which breaks up a picture into a tilelist. It works great, 
except, the first picture does not show up.

The renderer is a canvas with an image (subclasses add other images). It grabs 
the appropriate image from the parent component. (This image is dynamically 
created from a loaded image). 

Here is the renderer:

override public function set data(value:Object):void
{
_data=value;
invalidateProperties();
dispatchEvent(new 
FlexEvent(FlexEvent.DATA_CHANGE));
}

[Bindable(dataChange)]
override public function get data():Object
{
return _data;
}

[Bindable(dataChange)]
public function get listData():BaseListData
{
return _listData;
}

public function set listData(value:BaseListData):void
{
_listData=value;
list=listData.owner as TilePicture;
}

protected function setImage():void
{
image.source=list.imageFromRenderer(this);
}

override protected function 
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(this.unscaledWidth, 
this.unscaledHeight);
setImage();
}

Things I have tried:

1) in the parent, resetting the dp to force an update
2) forcing an update via dataChange
3) binding the image's source

These don't work. Not sure what to try next. Occasionaly and unpredictably, the 
image will update when 1) in a subclassed renderer, a second image is changed. 
But usually no amount of  interaction will make the first tile appear. 



RE: [flexcoders] first tile of tilelist does not show up

2009-11-17 Thread Alex Harui
Have you set columnWIdth/rowHeight explicitly?  I wouldn't let the TileList 
measure the renderer and decide for itself.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of mattgarland2000
Sent: Tuesday, November 17, 2009 11:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] first tile of tilelist does not show up



I have a component which breaks up a picture into a tilelist. It works great, 
except, the first picture does not show up.

The renderer is a canvas with an image (subclasses add other images). It grabs 
the appropriate image from the parent component. (This image is dynamically 
created from a loaded image).

Here is the renderer:

override public function set data(value:Object):void
{
_data=value;
invalidateProperties();
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}

[Bindable(dataChange)]
override public function get data():Object
{
return _data;
}

[Bindable(dataChange)]
public function get listData():BaseListData
{
return _listData;
}

public function set listData(value:BaseListData):void
{
_listData=value;
list=listData.owner as TilePicture;
}

protected function setImage():void
{
image.source=list.imageFromRenderer(this);
}

override protected function updateDisplayList(unscaledWidth:Number, 
unscaledHeight:Number):void
{
super.updateDisplayList(this.unscaledWidth, this.unscaledHeight);
setImage();
}

Things I have tried:

1) in the parent, resetting the dp to force an update
2) forcing an update via dataChange
3) binding the image's source

These don't work. Not sure what to try next. Occasionaly and unpredictably, the 
image will update when 1) in a subclassed renderer, a second image is changed. 
But usually no amount of interaction will make the first tile appear.