Thanks for the answer, and I'm so sorry for the erroneous posting, but I
guessed this would fit in the non UIComponent component category, such as
Effects, Formatters, Validators, etc.

So, how would I be doing the component with what you say, if I need it to be
visible intermittently, (but the logic always working). I'm not sure how to
actually do the [Embed] bit inside the component an assign it to itself.

Thanks,
Claudia

On 5/15/07, Josh Tynjala <[EMAIL PROTECTED]> wrote:

   If that's the case, the flexcomponents list probably isn't the correct
place to post your question. This group is all about building components for
Flex, and UIComponent is sort of a core part of that.

I'll answer your question anyway, since its an easy one.

[Embed(source="image.png")]
private var myImage:Class;

With that simple code, your image will be embedded, and you can use it
like any display object class. It will not be a subclass of UIComponent, so
you cannot use it within Flex containers or anywhere UIComponent is
required.

var instance:DisplayObject = new myImage();

I believe you can type instances as Bitmap, but I'm not 100% certain.



Claudia Barnal wrote:

 Hi all,

What is the most lightweight way to embed an image.

I am guessing it would involve Extending/Implementing the DisplayObject
class.
I don't want the overhead involved using anything spawned of the
UIComponent.

Thanks,
Claudia


Reply via email to