> > any suggestions on hwo to use this in a custom renderer? i'd like to
> > use it along w/some text in a tree or datagrid. not quite getting on
> > to load the rendered image via this.
>
> 'this' might work.

yeah i've tried that. but only seems to work for static data.

i've added nathan's method to the custom renderer's creationComplete &
it works fine when the data is static (see snippet below). but as soon
as i start pulling the xml from a java server via cf, i start getting
"TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at graphicRenderer/___HBox1_creationComplete()." errors. there's a
text widget in the same renderer that displays the text fine.

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"; width="400"
height="40" creationComplete="convertToImage(data.swatchLegend);">

private function convertToImage(hex:String):void {
        var b:Base64Decoder = new Base64Decoder( );
        b.decode(hex);
        var bA:ByteArray = b.flush();
        var l:Loader = new Loader();
        l.loadBytes( bA);
        var img:Image = new Image();
        img.addChild(l);
        this.addChild(img);
}

<mx:Text text="{data.label}" height="30"/>


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to