Skip to content

Instantly share code, notes, and snippets.

@sdrahan
Created August 12, 2017 08:35
Show Gist options
  • Select an option

  • Save sdrahan/a8e9f00d23cba38ec245635d7cb33f40 to your computer and use it in GitHub Desktop.

Select an option

Save sdrahan/a8e9f00d23cba38ec245635d7cb33f40 to your computer and use it in GitHub Desktop.
Download external SWF and use movieclips from it
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