Reputation: 1381
I've been trying to figure this out while im reinstalling flash(preview the work once and then wont let you do it again)
anyway what im trying to achieve is - AS reads a directory on a server lets say, it contains 10 images, this would create movie clips for each one and assign them to array "pockets"(im not sure if you can do this in AS, you can in PHP and JS so I'd expect so) then I'd use a repetitive function to manipulate each one of those images.
Could someone give me some guidance? Thank you!
Upvotes: 0
Views: 145
Reputation: 39466
Try a combination of FlashVars
and scandir()
in PHP.
The process would basically be:
scandir()
(PHP) to generate a list of images in a directory.implode()
(PHP) to convert the list to a string.split()
(AS3) to convert your string back to a list of images.Loader
class to add your images into the DisplayList.Upvotes: 2
Reputation: 74949
Flash cannot read a directory directly, neither can client-side JavaScript. You need server side code to give you a directory listing, like PHP or Java or ASP.NET. Once you have the directory listing, you create an array and dynamically load the images into a movieclip.
Here's a tutorial on creating on loading images without using components.
http://flashexplained.com/actionscript/loading-external-jpgs-into-your-main-swf-movie/
It's easier with components, but whether or not you want to use them depends on your situation and requirements.
Upvotes: 1