4 Replies Latest reply on Mar 9, 2007 9:23 AM by irukandji

    loading other pages with AS

      More simple questions I don't find in my flash book...

      In my main page I load my frame content into flash with _root.gotAndX(#), but when I wish to load other swf files into my main page what do I change the _root. to? Do I even need to change _root, or even use it?

      I know it must be loadMovie() or something similar to that, but how does one tell flash that the content lies outside the current document and also how to tell flash where this external content belongs inside the main document...

        • 1. Re: loading other pages with AS
          Arunkkumar2207j Level 1
          There are 2 options
          1. Place the whole content on particular frame say frame no 1, 5, 10, 15 etc. Than use _root.gotoAndStop(#). This is manual.
          2. Second option is create different swf file, than option new flash file, now suppose you want to load 1.swf in frame 1. Place code _root.loadMovie("1.swf", 1);, next 2.swf on frame 5 place code _root.loadMovie("1.swf", 1);
          • 2. loading other pages with AS
            irukandji Level 1
            thanks for the reply, but I believe I am more confused now than before..

            I get the content into my main document loading it into any specific frame number.. _root.gotoAndStop()
            but if my second swf file needs to be called into my first document upon a mouse click...say a menu button ... I use _root.loadMovie("second.swf", 1)
            what is the 1 for?? frame #1?

            if so does this mean I can call any external document into any frame of my main swf file using simple numbers?
            or have I truly become more confused than before...

            I tried the on (release) { _root.loadMovie ("1.swf", 1) } then tested the movie.
            I receive a type mismatch error when compiling...
            I am able to load an external swf by using the getURL function but I do not wish to load an entire new html embedded flash document...unless absolutely needed.
            • 3. Re: loading other pages with AS
              Level 7
              First of all, it's a bad idea to use numbers as file names. Don't do that.
              Second, using MovieClipLoader is a better practice than using loadMovie.
              Look up the MovieClipLoader class, in the Help, and do some reading. There
              are good examples in there.

              Basically - you can load an SWF into any movieClip on the stage.

              Dave -
              Head Developer
              Adobe Community Expert

              • 4. Re: loading other pages with AS
                irukandji Level 1
                First let me say THANKS! I've been reading about movieclips during my lunch break today... and was thinking that was the way to go..
                I did not intend to use numbers as file names but used it here as an example..

                Truly I am grateful for your insight into where to look and direction as to how to find what I am looking for.

                I'll do just as you suggest .