On Thu, Feb 21, 2008 at 4:30 PM, dsds99 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> Trying to make a simple component..and trying to set the background
> image..
>
> package{
> import flash.display.Bitmap;
>
> import mx.containers.HBox;
>
> public class Hbox1 extends HBox{
>
> [Embed(source="SkyBackground.jpg")]
> [Bindable]
> public var imgcls:Class;
>
> public function Hbox1():void{
>
> var img:Bitmap = new imgcls() as Bitmap;
> setStyle("backgroundImage",img);
>
> }
> }
> }
Change img to imgcls. You don't need to use the Bitmap.