Copy link to clipboard
Copied
I have images from a local folder that I would like to load into my flash presentation as an array.
I'm trying to do an Actionscript code. Is there anyway to do that?
2 Correct answers
Alright.
Please try this:
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.filesystem.File;
import flash.net.URLRequest;
var source:String = "./images"; // the source directory must be included in the AIR settings
var extensions:Vector.<String> = new <String>[ "bmp", "jpeg", "jpg", "png" ];
var parsedSource:String;
var foundImages:Array;
var
...
Copy link to clipboard
Copied
which line code is that?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@Caleb Washington : it's because you're targeting the Flash Player. You need to target AIR for Desktop. The File class is AIR-only.
Copy link to clipboard
Copied
And don't forget to include the source folder in the AIR settings.
Copy link to clipboard
Copied
Oh, so it doesn't work in regular flash, just AIR. Ok, I got you.
Copy link to clipboard
Copied
There are 10 items
Copy link to clipboard
Copied
oh, just list them in load_targetA.
Copy link to clipboard
Copied
odds are, you're correct.
op, is this an air app?
Copy link to clipboard
Copied
Yes it is. But, the file constant doesn't work.
Copy link to clipboard
Copied
Thank you for the help. 👍
-
- 1
- 2