1 Reply Latest reply on Jul 25, 2013 5:04 AM by Ned Murphy

    load movie clip cannot be resized problem

    teeronline Level 1

      Hello,

       

      Can anyone please take a look at my script,

       

      mybutton = this.createEmptyMovieClip("mc" + i, this.getNextHighestDepth());

          var loadTarget:MovieClip = mybutton.createEmptyMovieClip("loadTarget",0);

          var aFlag:String = arrayFlag[i].split("swf").join("jpg");

          loadTarget.loadMovie(aFlag);

          mybutton._x = 5 + distance;

          mybutton._y = 6 + ydistance;

       

      Now this script is within a for loop, it works fine the 'aFlag' would sit next to each other, but I want to resize (either aFlag/mybutton) a little bit, like this :

       

      mybutton = this.createEmptyMovieClip("mc" + i, this.getNextHighestDepth());

          var loadTarget:MovieClip = mybutton.createEmptyMovieClip("loadTarget",0);

          var aFlag:String = arrayFlag[i].split("swf").join("jpg");

          loadTarget.loadMovie(aFlag);

          mybutton._x = 5 + distance;

          mybutton._y = 6 + ydistance;

           mybutton._width =100;

           mybutton._height = 100;

       

      then all the loaded images previously appeared would be all gone, why? I don't understand,  setting _width/height is rather standard?

       

      help please

        • 1. Re: load movie clip cannot be resized problem
          Ned Murphy Adobe Community Professional & MVP

          The problem might be related to trying to set the size of an empty object... you cannot do that.  I don't know why that would eliminate the images, but it might be some wierd side effect.  You need to wait until the image file has loaded before trying to set the size of the object that contains it.

           

          See if you can work out using the MovieClipLoader class instead so that you can listen for completion of the loading and then resize to your liking.