Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Skoua/AS3-Assets-Loaders
Simple classes to load external assets in ActionScript 3
https://github.com/Skoua/AS3-Assets-Loaders
Last synced: 3 months ago
JSON representation
Simple classes to load external assets in ActionScript 3
- Host: GitHub
- URL: https://github.com/Skoua/AS3-Assets-Loaders
- Owner: Skoua
- Created: 2011-10-01T23:49:40.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-10-02T00:19:09.000Z (about 13 years ago)
- Last Synced: 2024-06-23T19:34:51.510Z (5 months ago)
- Language: ActionScript
- Size: 93.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actionscript-sorted - AS3-Assets-Loaders - Simple classes to load external assets in ActionScript 3 (Networking / Data Loader)
README
# AS3 Assets Loaders - v1.0 - October 2011
These classes let you load any image, swf or xml files without having to deal with events handling and creating loaders objects every time you need to.
Just import the classes and create a ImageLoader, SWFLoader or XMLLoader object, setup a complete and an optional progress event and you're done.## Example for loading an image
```js
import net.ImageLoader.as;
import events.ImageLoaderEvent.as;
var loader:ImageLoader = new ImageLoader();
loader.addEventListener(ImageLoaderEvent.COMPLETE, onComplete);
loader.load('my-file.jpg');
function onComplete(e:ImageLoaderEvent):void
{
e.target.removeEventListener(ImageLoaderEvent.COMPLETE, onComplete); // you don't have to but this is good for performance
var image:Bitmap = e.target.content;
// then do whatever you want with the image
}
```