vendredi 26 février 2016

AS3 - How do I import an external image to the stage while my program is running?

I've been trying to find a solution to this question for weeks but I haven't had any success so now it's finally time I turn to stackOverflow. I really hope you guys can help me out with this.

I'll explain a little better what exactly I'm trying to make and get done here.

I'm making a program in which I can make cards for my own cardgame. An important part of the program is that I can import images into the card-layout. The problem however, is that I have no clue how to program such a thing.

What I want (as I think it's the simplest way): I have a box with certain dimensions. When you click it, I want it to open the directory and allow you to import an image (JPG, PNG, etc.) and then I want the box to replace it's color with the image. (automatically cropped to the dimensions of the box) I only want it to change the color of the box to the image and not that it replaces the whole object, because I want to be able to still select another image if I want to.

I hope this isn't all too vague and that someone will be able to help me out here. A huge thanks already for your time even reading this!

Aucun commentaire:

Enregistrer un commentaire