LowRA allows using components and libraries linked together by a XML context file.
Specifically, it is possible to create a dictionary of items and a factory to treat these items using as3 code.
<dll url="assets/desktopIcons.dll"/> <dictionary id="desktopIconsDictionary" type="Dictionary"> <item><key value="news"/> <value type="Class" value="news"/></item> <item><key value="aide"/> <value type="Class" value="aide"/></item> <item><key value="compte"/> <value type="Class" value="compte"/></item> </dictionary> <dll url="miscdlls/TypedFactoryLocator.dll"/> <factory id="desktopIconsFactory" type="com.bourre.core.TypedFactoryLocator"> <argument type="Class" value="flash.display.MovieClip"/> <method-call name="add"> <argument ref="desktopIconsDictionary"/> </method-call> </factory>
var factory : TypedFactoryLocator = BeanFactory.getInstance().locate( "desktopIconsFactory" ) as TypedFactoryLocator; var iconNews : MovieClip = factory.build( "news" ) as MovieClip;
Discussion