public function SourceMovie():void { var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete); loader.load(new URLRequest('ExternalMovie.swf')); } private function onLoadComplete(e:Event):void { ApplicationDomain.currentDomain.getDefinition("com.scottgmorgan.ExternalMovie"); var myExternalMovie:ExternalMovie = ExternalMovie(e.target.content); myExternalMovie.alert('Hello World'); }
Another option you have is to use the ApplicationDomain class. Using the ApplicationDomain class you can add the classes from the ExternalMovie to the SourceMovie’s ApplicationDomain. This is a great way to load in code libraries at runtime.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSi j'ai bien compris SourceMovie.fla (est vide sans composant) mais il est branché sur la classe SourceMovie.as puis il compile