开发者

How to add image in the library

开发者 https://www.devze.com 2023-04-12 17:37 出处:网络
开发者_开发技巧I have the image path manipulate from database with php. Now how can i have to import those image in the library so that i can use them as a symbol. Thanks in advance.You cannot load it
开发者_开发技巧

I have the image path manipulate from database with php. Now how can i have to import those image in the library so that i can use them as a symbol. Thanks in advance.


You cannot load it into library, but you can load this image via php and use it on stage with action script. Take a look at this answer to the similar question:

Load image dynamicly in flash


You can download it to the server and generate source file with Class that have field like this:

 class Library
 { 
   [Embed(source = 'path_to_folder/image_name.png')] public static var imageClass : Class;
 }

Alsou you should refer this class somewhere to be sure it will be compiled into your swf and use it like this:

 const image:Bitmap = new (Library.imageClass)();

In that case you need to recompile your swf every time the image is changed.

But I'm totaly agree with Bartek that it is better to use dynamic loading.

0

精彩评论

暂无评论...
验证码 换一张
取 消