How can I access an image embeded in a custom component?

Hello

I'm using Flex 3 and I want to access an image embedded in a custom component.

Let's say that I included an image in the root of the application with the following code:

[Embed ("myImage.jpg")]
public var myImg: Class;

... and I made a custom in ActionScript using VBox as the base component

... and add an image control to the custom component.

Is it possible that I can use the image embeded as a source for the image in the custom control?

Hi the CCJA.

Yes you can do...

Just use as shown below.

Import mx.core.Application;

Don't forget to import the namespace above...

Application.application gives a reference you to upper-class main level. of demand... and the variable of integration must be public, as you had already kep...

Thank you

Jean Claude

Tags: Flex

Similar Questions

Maybe you are looking for

  • Flash player problem

    When I am playing the video on YouTube or a stream of sports channels on my laptop I can not because the flash player crashes, I have the latest Firefox and flash player installed, I tried all the troubleshooting but nothing works, please help solve

  • Question VI motor bike

    Hello I'm writing a VI that performs a cycle continuously a stepper motor that is connected to a linear actuator. I wish I could order to move the linear actuator of 2 inches, retract 0 thumb and loop this profile so that she could continue to move w

  • LifeCam HD3000 - without audio

    Hello Can I install the Lifecam HD3000 on a mac? I tried it, but even if I have the photo there is no audio data. Can you please advise me what to do? Thank you.

  • BlackBerry 10 Q10 screen problem in Blackberry 10.3 sizing

    Everyone has noticed it seems to be a problem of calibration screen Blackberry 10.3. When you wake up the screeen with a gesture or pull the handset from the pocket of Q10, the screen that he 'wakes up' until it is expanded, forcing the user to use g

  • HP7510 photo printing

    I have three frustrating questions with my HP7510 I hope you can help me with. 1. the pictures to print with my macbook pro (OS X 10.9.4) are terrible. They are dark and discoloured.  It seems that my ink cartridges are good.  There is a warning for