1 Reply Latest reply on Jul 31, 2009 11:45 PM by ShardulSingh

    How to attach an image

    SiHoop Level 1

      I want to attach an image to a Sprite named spriteBg and I need to do it using actionScript.

       

      I've been trying the following (my image is in the same folder as the class file), and I can draw the graphic shape, but the image won't show up. Is there a better way to do this?

       

               myImage=new Image
               myImage.source="@Embed('checkmark_green.png')"
               spriteBg.addChild(myImage)
               spriteBg.graphics.beginFill(0x00ffff);
               spriteBg.graphics.drawRect(0,-30,10,10);