1 Reply Latest reply on May 15, 2006 8:20 AM by bwatson0

    Need help loading multiple movie clips.

    bwatson0
      Hello forum members,

      I've run into a bit of an irritating problem and perhaps someone can clue me in to the answer.

      I'm creating a SWF which uses loadMovie (I've also tried creating a MovieClipLoader instance and using instance.loadClip) to bring in 2 other SWFs.

      See below AS in first couple frames of main movie's time-line:

      First movie:

      this.createEmptyMovieClip("mcToolbar", 10);
      with (mcToolbar)
      {
      _x=8;
      _y=68;
      }
      loadMovie("toolbar.swf",mcToolbar);

      Second movie:

      this.createEmptyMovieClip("mcWindow", 11);
      with (mcToolbar)
      {
      _x=500;
      _y=60;
      }
      loadMovie("textwindow.swf",mcWindow);

      This works great when opening up my main SWF in Flash Player and when viewing the movie in the published HTML web page.

      However, I'm using FlashObject to load my main movie to get around that annoying "Click to activate this control" thing.

      When viewing this version of the web page with my main SWF being loaded, I see the SWF load, then the first loadMovie loads....THEN the first loadMovie disappears and the second loadMovie loads and appears at the wrong X and Y coordinates.

      Any ideas?
        • 1. Re: Need help loading multiple movie clips.
          bwatson0 Level 1
          Ok, I know replying to my own post is odd on some forums, but anyhow:

          I've done some further testing and find that FlashObject isn't the problem.

          Looking at the AS code above, it is clear that the SWFs to be loaded must be in the same folder as the HTML web-page.

          However, my intent is that these small SWFs that are being loaded in by the main SWF will be shared by many other movies, therefore I'd like to stick them (the physical SWF files) closer to the root of the site (e.g. SiteFoler->flash).

          I see that my problem rears its ugly head when I try to reference these movies in my main flash movie as follows:

          First movie:

          this.createEmptyMovieClip("mcToolbar", 10);
          with (mcToolbar)
          {
          _x=8;
          _y=68;
          }
          loadMovie("../../../flash/toolbar.swf",mcToolbar);

          Second movie:

          this.createEmptyMovieClip("mcWindow", 11);
          with (mcToolbar)
          {
          _x=500;
          _y=60;
          }
          loadMovie("../../../flash/textwindow.swf",mcWindow);

          In the example above, my HTML page is 3 folders deep whereas the movies I'm loading in are 1 folder deep in the folder labeled "flash".

          By doing it in this manner, I get the problems I described above (first movie loads then disappears and second movie loads in wrong position).

          Any ideas as to why the physical location of the SWFs being pulled in is causing this problem? I'd like to try to avoid copying the SWFs to each place their being refrenced from as that could be a major maintenance headace.

          Thanks,

          Ben