2 Replies Latest reply on Sep 1, 2006 7:38 AM by nschubach

    loading swf into movieclip object

      I am trying to load a swf file into a movieclip object on the stage. The movieclip object is sized smaller than the screen, and placed in the middle. I have defined a loader with:
      var myMovieClipLoader:MovieClipLoader = new MovieClipLoader();
      then use it like this:
      _level0.myMovieClipLoader.loadClip("moviename.swf", _level5.movieclipinstancename);
      (the movieclip object is used in a swf loaded in level5)

      When I load the swf like this, the swf loads at the correct location according to where I have placed the movieclip object, however it "blows up" to fill the screen from that point down and across, ignoring the size of the movie clip object (the loading swf actually expands beyond it's created size to fill the screen, making all the graphics and text much larger than intended). The actual pixel size of the swf I'm trying to load matches the size of the movieclip object (1024x350 in a 1280x1024 screen).

      What is the magic setting or property that will tell the loading swf to honor the size of the movieclip object I'm loading into?

      Thanks for your help!

        • 1. Re: loading swf into movieclip object
          Something I've been working on:
          Place the following code in a new file <your project folder>\as\MovieContainer.as
          Then open the properties for the symbol you want to be your movie container
          Set the AS 2.0 Class to as.MovieContainer and give it a name (I named mine 'loader').
          To load the movie, simply call:

          Hope that makes sense. Basically, it's just a self contained class for loading into an object on the scene. It draws a simple progress bar on the center of the symbol when it's loading and it resizes the loaded object on init to conform to the size of the object on the stage. Why queueSWF? Well, if it's currently loading a SWF, it will wait till it's finished and load a new one. The biggest problem right now is the progress bar, but it's fairly easy to remove if you don't like it. Hopefully it helps.

          If anyone else is reading this. I'm trying to figure out if I can load these movies into an array of movieclips. So far I've had no luck. If you know of a way, feel free to drop some input.

          • 2. Re: loading swf into movieclip object
            nschubach Level 1
            oops, I just realized that's the version without the reset for 'loading'

            Just replace the onLoadInit function with this: