Created
August 12, 2017 08:35
-
-
Save sdrahan/a8e9f00d23cba38ec245635d7cb33f40 to your computer and use it in GitHub Desktop.
Download external SWF and use movieclips from it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var loader:Loader = new Loader(); | |
| var url:URLRequest = new URLRequest("http://path-to-server.com/downloadable_templates.swf"); | |
| loader.load(url); | |
| loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded); | |
| function onLoaded(event:Event):void | |
| { | |
| var cls: Class = event.target.applicationDomain.getDefinition("MovieClipWithPlaceholders") as Class; | |
| var mcWithPlaceholders:MovieClip = new cls(); | |
| addChild(mcWithPlaceholders); | |
| // подставляем фотографии в плейсхолдеры | |
| var facePhoto: Sprite = new UserFaceSprite(); | |
| mcWithPlaceholders.getChildByName("placeholder1").addChild(facePhoto); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment