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


hi,

 

i using flex 3 , want access embeded image custom component.

 

let's have embedded image in root of application following code:

 

            [embed("myimage.jpg")]
            public var myimg:class;

 

... , have made custom component in actionscript using vbox base

... , added image controll to custom component.

 

is there way can use embeded image source image in custom control?

hi ccay,

 

yes can it...

 

just use shown below..

 

import mx.core.application;

 

<mx:image source="{application.application.myimg}" />

 

don't forget import above namespace ..

 

application.application gives reference application top level main class...and embed variable should public had kep already..

 

thanks,

bhasker



More discussions in Flex (Read Only)


adobe

Comments