AS3从子目录加载图像

时间:2022-10-12 15:25:21

Is there a way to get all filenames within a subdirectory in flash using ActionScript?

有没有办法使用ActionScript在Flash的子目录中获取所有文件名?

From the research I've done, it seems like the answer is no, unless using AIR. This is not an option for me.

从我所做的研究来看,似乎答案是否定的,除非使用AIR。这对我来说不是一个选择。

What alternatives are there? Can I do something like this using XML or something?

有什么替代品?我可以使用XML或其他东西做这样的事吗?

If so, where should I look to figure this out/what are some suggestions?

如果是这样,我应该在哪里找出这个/什么是一些建议?

What I want to do is: Load all filenames into an array, then use that array to load images into my swf.

我想要做的是:将所有文件名加载到一个数组中,然后使用该数组将图像加载到我的swf中。

Can this be done without AIR?

没有AIR可以做到这一点吗?

I'm using CS5.5.

我正在使用CS5.5。

1 个解决方案

#1


You could write a separate program (in AIR, or in something else) that scans a directory, generates an XML file, and stores it in a place where your SWF has access to it.

您可以编写一个单独的程序(在AIR中,或在其他程序中),它扫描目录,生成XML文件,并将其存储在SWF可以访问它的位置。

From there you can load the XML with Flash, parse it, and load your images.

从那里,您可以使用Flash加载XML,解析它并加载图像。

#1


You could write a separate program (in AIR, or in something else) that scans a directory, generates an XML file, and stores it in a place where your SWF has access to it.

您可以编写一个单独的程序(在AIR中,或在其他程序中),它扫描目录,生成XML文件,并将其存储在SWF可以访问它的位置。

From there you can load the XML with Flash, parse it, and load your images.

从那里,您可以使用Flash加载XML,解析它并加载图像。