You can load Flex automation support at run time using the Silk Test Flex Automation Launcher. This application is compiled with the automation libraries and loads your application with the SWFLoader class. This automatically enables your application for testing without compiling automation libraries into your SWF file. The Silk Test Flex Automation Launcher is available in HTML and SWF file formats.
import flash.display.*; import flash.net.URLRequest; import flash.system.ApplicationDomain; import flash.system.LoaderContext; var ldr:Loader = new Loader(); var urlReq:URLRequest = new URLRequest("RuntimeClasses.swf"); var context:LoaderContext = new LoaderContext(); context.applicationDomain = ApplicationDomain.currentDomain; loader.load(request, context);