package
{
import flash.display.Sprite;
// This _must_ inherit from Sprite, or the resources can't be attached to
// the main movie.
public class Resources extends Sprite
{
// List your resources here, as public variables
[Embed(source="mysource.swf",symbol="AnySymbol")]
public var SomeSymbol:Class;
}
}
compile:
mxmlc Resources.as -output resources.swf -sp . -no-network=false
"...load it into your app using a standard flash.display.Loader, without specifying an applicationDomain. Once loaded, get at the assets like this:"
var ResourceClass:Class = loader.contentLoaderInfo.applicationDomain.getDefinition("Resources") as Class;
var resources:Object = new ResourceClass();
var symClass:Class = resources['SomeSymbol'] as Class;
var symbol:MovieClip = new symClass() as MovieClip;
http://wildwinter.blogspot.com/
0 megjegyzés:
Megjegyzés küldése