5 Replies Latest reply: Aug 19, 2013 12:45 PM by kglad RSS

    load external files

    Ron Colmen Community Member

      I created fifteen 300 X 250 sized movieclips. I've adjusted each movieclip into different sizes. Now I need to load 15 external files in to these movieclips. (all external files are 300 X 250).

       

      1. When I load the external files, all the loaded files does not adjust to the resized movieclips (all external files are maintaining it original size). I need the loaded files to be resized as per the movieclips on stage.

      2. Is there a short way of writing the code to load these 15 external files?

       

      //movieclips on stage: gHolderF0, gHolderF1, gHolderF2

      //external files : sample0.swf, sample1.swf, sample2.swf

       

      I'm using this to load each external file:

      var loaderPrototype:Loader = new Loader();

      var selectedPrototype:URLRequest=new URLRequest("sample/sample0.swf");

       

      loaderPrototype.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);

      loaderPrototype.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

      loaderPrototype.load(selectedPrototype);

       

      function finishLoading(loadEvent:Event) {

      gHolderF0.addChild(loadEvent.currentTarget.content);

      addChild(gHolderF0);

      }

       

      function errorHandler(errorEvent:Event):void {

      trace("file missing");

      }

       

      function errorHandler(errorEvent:Event):void {

      trace("file missing");

      }