Howto embed images in Actionscript 3 / Flex 3 the right way? -


I am creating a game where a lot of images are being used in Action Script / Flex 3 (Flash) When I went to the Designer stage, I would have to prepare a structural way of using embedded images (which is to be tampered with rotation, color, etc.).

Unfortunately, after a little investigation, it seems that before you can use them, they have to be manually embedded. I currently set it up like this:

Resource.as class file:

  package {public final category processing {[embed (source = "/ property / ship / 1.gif")] public static constant SHIPS_1: class; }}  

Therefore, for a ship I just want to do this:

Insert an image into the correct folder with the correct name in the Resource.as file Make the same with the same name in the Resource.as file

Although it is possible only by putting the file into a specified folder.

To make things even worse, I still have to use it:

  var test: bitmap = new resource SHIPS_1 ();  

Should there be a better way to handle resources while building large applications? Imagine I need thousands of images, this system just does not fit.

instead of

  var test: bitmap = new resource. SIPES ();  

Use

  myImage.source = resource. SIPSES;  

Embedding is correct: The way you use it is wrong :)

Adrian


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -