3 Replies Latest reply on Jun 21, 2007 11:12 AM by kglad

    Can you load an external swf without a button?

    Jonibean Level 1
      I have a slideshow in swf format that I would like to load into my main flash movie. I have created a target movie clip. I was hoping to be able to just have it load when the page was entered - does it have to be on a button? I have two different buttons that will access this page - is there any conflict to have the same code on each button?

      I have tried a number of different things to get it to load, but it isn't working. This is my current code. The output says I need to put a 'stop' action within the event handler. I am not sure what to do...

      stop();
      _root.mc1.loadMovie("whatever/whatever.swf");

      I also tried putting this code on to my main button, but it just flashed to the page and then off again. I added the second stop action because it said I needed stop in there, which I'm not sure about as there is a stop already...?

      on (release) {
      gotoAndStop(5);
      loadMovie("slideshow/slideshow.swf", "mc1");
      stop()
        • 1. Re: Can you load an external swf without a button?
          kglad Adobe Community Professional & MVP
          you need not attach loadMovie() code to a button. your 2nd line of code is fine.

          if you have a movieclip on your main timeline with instance name mc1, and you have a swf file named whatever.swf in the whatever sub folder of your _level0 html, then whatever.swf will load.

          if you want to control whatever.swf's timeline AFTER it completes loading, reference _root.mc1.
          • 2. Re: Can you load an external swf without a button?
            Jonibean Level 1
            Thanks so much for the help. It still isn' t working though. I have a button that goes to my frame 'About' when clicked. On the 'About' frame, I have a movie clip instance, coloured grey, to load the slideshow into. But when I test it, the slideshow doesn't load, and the movieclip instance doesn't appear either - it's grey, and it just shows the black background. This is the code on my 'About' frame, in the actionscript layer.

            stop();
            _root.mcHolder.loadMovie("slideshow/slideshow.swf");

            I have a folder in the root folder called 'slideshow', which holds the 'slideshow.swf'.

            Any ideas on what the problem might be?
            • 3. Re: Can you load an external swf without a button?
              kglad Adobe Community Professional & MVP
              what do you mean by "..it just shows the black background"? the black background of what?

              if you test your swf in the flash test environment you'll see an error message if that path/file name aren't correct. if you don't see that message then your gray movieclip is being replaced by slideshow.swf. perhaps there's nothing on-stage in your swf's first frame and there's a stop() in that first frame?