Revision: 58696
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 29, 2012 09:59 by burakkirkil
Initial Code
//AssetManager.as // usage: AssetManager.getInstance.getAssetByName("MonaLisa"); package { import flash.utils.describeType; import flash.utils.getDefinitionByName; public class AssetManager { [ Embed( source="/../assets/fonts/American Typewriter.ttf", fontName="AmericanT", mimeType="application/x-font-truetype" ) ] public static const FONT_AMERICA_T:String; [ Embed( source="/../assets/library.swf", symbol="Square") ]; private var Square:Class; [ Embed (source="/../assets/Mona_Lisa.jpg") ] private var MonaLisa:Class; private static var instance:AssetManager; public static function getInstance():AssetManager { if (instance == null) instance = new AssetManager(); return instance; } public function getAssetByName( name:String ):* { var className:String = describeType( this )[email protected](); var fullname:String = className + "_" + name; var ref:Object = getDefinitionByName( fullname ); return new ref(); } } }
Initial URL
Initial Description
Simple Asset Manager with Embed Style
Initial Title
Simple Asset Manager with Embed Style
Initial Tags
Initial Language
ActionScript 3