Amy:

It seems easier this way since I'm using a dataprovider which is updated often, 
changing the icon.  Right now I'm using a switch statement which tests 
"value.icon" and returns the proper embedded image class name.  I'm confused as 
to why I can't convert the String the "image1" to Class image1.  Seems easy 
enough, but nothing works.

Thanks,
Brandon



----- Original Message ----
From: Amy <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, July 22, 2008 10:04:34 AM
Subject: [flexcoders] Re: referencing embedded images inside 
AdvancedDataGridGroupItemRenderer


--- In [EMAIL PROTECTED] ups.com, Brandon Krakowsky <krakowskyb@ ...> 
wrote:
>
> I've embedded some images like so:
> 
> [Embed(source= "images/image1. png")]
> private var image1:Class;
> 
> [Embed(source= "images/image2. png")]
> private var image2:Class;
> 
> I can't seem to reference these class names from a String like so:
> 
> override public function set data(value:Object) :void {
>     img = new Image;
>     img.source = getDefinitionByName (value.icon) as 
Class; //getDefinitionByNa me is part of flash.utils package
>     img.width = 22;
>     img.height = 22;
>     addChild(img) ;
> }
> 
> I also tried the following:
> value.icon as Class
> Class(value. icon)

Why not just use an iconFunction?

-Amy

    


      

Reply via email to