3 Replies Latest reply on Dec 22, 2007 7:44 AM by Greg Dove

    Loadmovie resizing

      Hi there all,

      I am a newby to flash and this forum.

      I need some help with changing the size of a swf when loaded into an empty movieclip. Example: the main movie size is 500 wide by 400 high, the swf being loaded is larger in size. How do I adjust the size to be the same as the main movie? or perhaps slightly smaller than the main movie so that the buttons of the main movie is not covered up? Can anyone help with the appropriate script. I am using flash 8 professional.

      Look forward to some help asap,
      thanks Ukhti
        • 1. Re: Loadmovie resizing
          Greg Dove Level 4
          Your best bet is to use the MovieClipLoader class, with a listener.
          The listener receives a reference to the loaded movieclip in its onLoadInit handler. This handler is triggered when the loaded swf is capable of being resized etc...

          Take a look at the examples in the MovieClipLoader class in the help files or the livedocs online. Give it a try and then post back with questions or parts of your code you can't get working if you have difficulty making it work.

          When you choose reply on this forum you will have an extra button called "attach code" ... If you ever have difficulty with parts of your code its a good idea to show small parts here. But don't put it directly in your reply... always use the attach Code button for your code. Otherwise it can mess up the html formatting.
          • 2. Re: Loadmovie resizing
            ukhti Level 1
            Thanks for your reply, but I am not experienced enough to understand this reply (loadmovie class). Is there an easy script I can use (ie width and height resize) to resize the movie being loaded into the empty movieclip so that it is smaller than the main movie into which it is being loaded?
            • 3. Re: Loadmovie resizing
              Greg Dove Level 4
              You could use a Loader Component. I'm pretty sure that gives you the option to scale the loaded content automatically. drag one from your components panel and change the scaleContent setting in the parameters tab. You will need to read up on the Loader class if you want to set its properties at runtime from actionscript (after giving your component an instance name).