goodm
goodm

Reputation: 7295

Air App / AS3 - Load all images from folder

I need to load all images in one folder. How I can do that? I have to create selector, but not the system one. Thats why I want to load all pic from folder ( it can be system selector for folder ).

Thanks for any help.

Upvotes: 1

Views: 1179

Answers (1)

Brian Genisio
Brian Genisio

Reputation: 48127

What I think I understand you are asking: How to give a list of files in a DropDownList?

<fx:Declarations>
    <s:ArrayCollection id="files" />
</fx:Declarations>

<s:initialize>
    <![CDATA[
        var folder:File = new File("/path/to/folder/");
        for each(var file:File in folder.getDirectoryListing()) {
            files.addItem(file.nativePath);
        }
    ]]>
</s:initialize>

<s:VGroup>
    <s:DropDownList dataProvider="{files}" width="300" />
</s:VGroup>

Upvotes: 1

Related Questions