Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How do I import an image that has transparent background to flash and give it class and use addChild to show it on the screen? Transparent background should stay transparent.

share|improve this question
add comment

closed as off topic by Tim Holt, Byte56, Jari Komppa, Sam Hocevar, jhocking Jan 17 '13 at 14:04

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

This is answered on the main StackOverflow: http://stackoverflow.com/questions/8005068/better-way-to-include-images-in-as3-than-embed

In summation, you can either include your images in the swf and then call them from the code, or you can load external images. If you have the Flash authoring tool then one approach would be to import the image in the authoring tool, and then in the Library go into the Properties and set the ActionScript linkage for that image. If you don't have the Flash authoring tool then the equivalent approach is to use [Embed] tags at the top of your code.

If you can't or don't want to include the images in the swf (eg. loading user images) then use Loader

share|improve this answer
    
if i import the image background is not trasnparent and i need to import it that's the problem –  newplayerhere Jan 15 '13 at 15:38
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.