The Load class provides a set of static methods to load text, images or bytes async by using Lime Futures.
Data can be loaded from the filesystem (by specify a filename e.g. "assets/..."") or also via http/https protocol (by specify an url adress).
Static variables
staticcorsServer:String = ""
A string what have to set to the adress of a Cors-Server to load data from different web domains as where it is hosted (only for html5-target).
Static methods
staticimage(name:String, debug:Bool = false, ?onProgress:(Int, Int) ‑> Void, ?onLoad:Image ‑> Void, ?onError:String ‑> Void):Void
Loads a single lime Image and calls onLoad afterwards.
Parameters:
| name | filename or url | 
|---|---|
| debug | (optional and  | 
| onProgress | callback for the progress handler (param: already loaded and total amount of bytes) | 
| onLoad | callback if loading is complete (param: image) | 
| onError | callback if an error occurs (param: error message) | 
staticimageArray(names:Array<String>, debug:Bool = false, ?onProgress:(Int, Int, Int) ‑> Void, ?onProgressOverall:(Int, Int) ‑> Void, ?onLoad:(Int, Image) ‑> Void, ?onLoadAll:Array<Image> ‑> Void, ?onError:(Int, String) ‑> Void):Void
Loads multiple lime Images into parallel. Calls onLoad after each and onLoadAll after all are completely loaded.
Parameters:
| name | Array of filenames or urls | 
|---|---|
| debug | (optional,  | 
| onProgress | callback for the progress handler per image (param: image number, already loaded and total amount of bytes) | 
| onProgressOverall | callback for the progress handler for all images together (param: already loaded and total amount of bytes) | 
| onLoad | callback after each single image is loaded (param: image number and the image itself) | 
| onLoadAll | callback if all images are completely loaded (param: array of loaded images) | 
| onError | callback if an error occurs (param: image number and error message) | 
staticbytes(name:String, debug:Bool = false, ?onProgress:(Int, Int) ‑> Void, ?onLoad:Bytes ‑> Void, ?onError:String ‑> Void):Void
Loads single Bytes and calls onLoad afterwards.
Parameters:
| name | filename or url | 
|---|---|
| debug | (optional and  | 
| onProgress | callback for the progress handler (param: already loaded and total amount) | 
| onLoad | callback if loading is complete (param:  | 
| onError | callback if an error occurs (param: error message) | 
staticbytesArray(names:Array<String>, debug:Bool = false, ?onProgress:(Int, Int, Int) ‑> Void, ?onProgressOverall:(Int, Int) ‑> Void, ?onLoad:(Int, Bytes) ‑> Void, ?onLoadAll:Array<Bytes> ‑> Void, ?onError:(Int, String) ‑> Void):Void
Loads multiple Bytes into parallel. Calls onLoad after each and onLoadAll after all are completely loaded.
Parameters:
| name | Array of filenames or urls | 
|---|---|
| debug | (optional,  | 
| onProgress | callback for the progress handler per bytes (param: bytes number, already loaded and total amount) | 
| onProgressOverall | callback for the progress handler for all bytes together (param: already loaded and total amount) | 
| onLoad | callback after each single bytes is loaded (param: bytes number and the bytes itself) | 
| onLoadAll | callback if the data of all bytes are completely loaded (param: array of loaded bytes) | 
| onError | callback if an error occurs (param: bytes number and error message) | 
statictext(name:String, debug:Bool = false, ?onProgress:(Int, Int) ‑> Void, ?onLoad:String ‑> Void, ?onError:String ‑> Void):Void
Loads a single text into a String and calls onLoad afterwards.
Parameters:
| name | filename or url | 
|---|---|
| debug | (optional and  | 
| onProgress | callback for the progress handler (param: already loaded and total amount) | 
| onLoad | callback if loading is complete (param:  | 
| onError | callback if an error occurs (param: error message) | 
statictextArray(names:Array<String>, debug:Bool = false, ?onProgress:(Int, Int, Int) ‑> Void, ?onProgressOverall:(Int, Int) ‑> Void, ?onLoad:(Int, String) ‑> Void, ?onLoadAll:Array<String> ‑> Void, ?onError:(Int, String) ‑> Void):Void
Loads multiple text as Strings into parallel. Calls onLoad after each and onLoadAll after all are completely loaded.
Parameters:
| name | Array of filenames or urls | 
|---|---|
| debug | (optional,  | 
| onProgress | callback for the progress handler per text (param: text number, already loaded and total amount) | 
| onProgressOverall | callback for the progress handler for all texts together (param: already loaded and total amount) | 
| onLoad | callback after each single text is loaded (param: text number and the text itself) | 
| onLoadAll | callback if the data of all texts are completely loaded (param: array of loaded texts) | 
| onError | callback if an error occurs (param: text number and error message) |