jaycsantos / as3-RSLLoader

Little helper class to load swf files as RSL or embedded library on debug or release build respectively.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

as3-RSLLoader

Little helper class to load swf files as a realtime shared library (for debug builds) or an embedded library (for release builds) respectively. Or at least that was the initial thought.

note: Project was made in flashdevelop.


how to

to load external files (must be relative to ouput swf location, unless you have your domain policies checked)

RSLLoader.loadExternal( optionalCallback, "rsl/visualAssets.swf" );

to load embedded files

[Embed(source="../bin/rsl/visualAssets.swf", mimeType="application/octet-stream")]
public var VisualAssetsClass:Class;
RSLLoader.loadEmbedded( optionalCallback, new VisualAssetsClass );

This, plus conditional compilation constants (like in FD), switching from using RSL during debug while embedding during release compiles would require almost zero effort.

CONFIG::debug {
	RSLLoader.loadExternal( start, "rsl/visualAssets.swf" );
}
CONFIG::release {
	RSLLoader.loadEmbedded( start, new VisualAssets() );
}

One tip is to add the swc as an external library yet excluded from compile to get class definitions. This way the auto-complete and syntax checks would still work correctly.

About

Little helper class to load swf files as RSL or embedded library on debug or release build respectively.

License:MIT License


Languages

Language:ActionScript 100.0%