3 Replies Latest reply on Jan 5, 2012 5:02 AM by Ned Murphy

    How to Dynamically Resize SWF width and Height

    Umesh Gamit Level 1

      hi friends

       

      i have different size (wxh) swf files, and i have to load different swf in one SWf file(say name sample.swf) now what my problem is when i load different swf in my sample.swf either it crop disply if bigger swf load or it leave space if it small..

       

      sample.swf(300x300)

       

      1.swf(200x200)

      2.swf(400x400)

      3.swf(300x300)

      4.swf(100x500)

      5.swf(50x350)

        • 1. Re: How to Dynamically Resize SWF width and Height
          Ned Murphy Adobe Community Professional & MVP

          You should be loading the swf's into a movieclip, so you can resize that movieclip after the swf has been loaded.  You should be using the MovieClipLoader class so that you can have a listener to determine when loading is complete.  You will need something inside the loaded swf to indicate what its normal dimensions are so that you can scale it accordingly.  When the file loading is complete, you check the normal dimension info and use it to change the _xscale and _yscale properties of the movieclip.

          • 2. Re: How to Dynamically Resize SWF width and Height
            Umesh Gamit Level 1

            thnx Ned Murphy

             

            but can my parent SWF (Sample.swf) resize with loaded SWF WxH

             

            e.g

            id my Sample.swf Wxh is 300x300

            and when load 2.swf @ that time can my Sample.swf WxH possible to resize with 400x400

             

             

            ??

            • 3. Re: How to Dynamically Resize SWF width and Height
              Ned Murphy Adobe Community Professional & MVP

              The parent can resize the movieclip after it has been loaded, not before.  So you need to load the movie using the MovieClipLoader class so that you can assign a listener to determine when it has finished loading.  If you look up MovieClipLoader.addListener in the help documents there is an example there that shows how to detect when the file has been loaded.