Good call. The test image shows up. So it looks like the first image I 
dynamically create is either not available when assigned or incorrectly 
created. Looking into it...

--- In flexcoders@yahoogroups.com, "jamesfin" <james.alan.finni...@...> wrote:
>
> Put this code in and see if an image appears in the first slot.  If so, your 
> image source logic is incorrect.
> 
> test.png is a sample image...
> 
> [Embed(source="test.png")]
> [Bindable]
> public static var testImage:Class;
> 
> override protected function commitProperties():void{
>                       
> super.commitProperties();
> image.source=testImage;
> 
> }
> 
> 
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "mattgarland2000" <alias@> wrote:
> >
> > 
> > 
> > Thanks, that makes sense, but it does not work here, unfortunately. I think 
> > I might try to defining some states for the renderer and see if using 
> > states takes care of this if it is some weird timing/updating issue.
> > 
> > --- In flexcoders@yahoogroups.com, "jamesfin" <james.alan.finnigan@> wrote:
> > >
> > > Move the setImage into commitProperties and you should be good to go...
> > > 
> > > 
> > > override protected function commitProperties():void{
> > >                   
> > > super.commitProperties();
> > > 
> > > setImage();                       
> > > 
> > > }
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com, "mattgarland2000" <alias@> wrote:
> > > >
> > > > 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.
> > > >
> > >
> >
>


Reply via email to