I was trying to follow the logic in the mx:Button class on how to add
an icon to a simple UIComponent i created with a setter that looks
like this:
<view:SimpleFunComponent id="toolButton"
icon="@Embed(source='/assets/tool_icon.swf')"/>
I don't really understand how to cast my classname (as i was trying to
extract some stuff out of button to help me out - but it's way
complicated). I cam getting errors - any way I dice this. Would
somebody have a little time who has experience help me to road of
total happiness please. Maybe I am close, but i am probably way off.
Thanks for your help, this is a little over my head working with
metadata trying to create a class on the fly.
Ptrick
public function set icon(tempIconName:String):void
{
var newIconClass:Class = Class(tempIconName);
var newIcon:IFlexDisplayObject;
newIcon = IFlexDisplayObject(new newIconClass());
addChild(DisplayObject(newIcon));
}