8 Replies Latest reply on Jul 12, 2008 12:10 PM by scharlton22

    Blank Movie Clip

    scharlton22
      Good day everyone, I am trying to create a blank movie clip and place it on a layer on my root movie, however it won't work?
      I think it is the original blankmovie. Can someone walk me through creating a blank movie clip to load others into.

      I have the button action to load to the clip as this: blank_mc.loadMovie("Bob.swf");

      Any elementary level help would be great!!
        • 1. Re: Blank Movie Clip
          Level 7
          scharlton22,

          > Can someone walk me through creating a blank movie clip
          > to load others into.

          Select Insert > New Symbol. In the dialog box that opens, set the Type
          to Movie Clip, give it a Library name in the Name field, and click OK to
          close the dialog box. You'll see a new movie clip symbol in the Library by
          whatever name you gave it. Drag that movie clip to the Stage. Because it's
          empty, it will show up as a small white placeholder circle.

          Click the placeholder circle to select the symbol, and give it an
          instance name (such as blank_mc) in the Property inspector. At that point,
          your earlier code:

          > blank_mc.loadMovie("Bob.swf");

          Should work. That invokes the MovieClip.loadMovie() method on the
          blank_mc instance.


          David Stiller
          Co-author, Foundation Flash CS3 for Designers
          http://tinyurl.com/2k29mj
          "Luck is the residue of good design."


          • 3. Re: Blank Movie Clip
            scharlton22 Level 1
            that seems very complec compared to how I understood it to work?
            How do I actually create a blank movieclip, or am I dumb? What you have provided me does that?
            • 4. Re: Blank Movie Clip
              Level 7
              scharlton22,

              > that seems very complec compared to how I understood it to work?

              What dz showed you is one of many ways to load content in AS2.
              Personally, I use dz's approach more often than the more simplified
              MovieClip.loadMovie() method, because the MovieClipLoader approach lets me
              know when content has loaded. That becomes very important if you want to
              use ActionScript to manipulated loaded content once it arrives.

              > How do I actually create a blank movieclip, or am I dumb? What you
              > have provided me does that?

              dz's suggestion creates a blank movie clip with ActionScript
              (this.createEmptyMovieClip()), but you can just as well create a movie clip
              in the Library by hand. Again, for what it's worth, I usually create blank
              movie clips with ActionScript, but the choice is yours.

              It really depends on whether or not you want to know when your content
              is loaded. If you use loadMovie(), you won't know -- unless you write
              additional ActionScript that lets you know. If knowing is important to your
              project, I recommend MovieClipLoader, same as dz does. If you prefer an
              older approach, you can read about it (and the other) here:

              http://www.quip.net/blog/2006/flash/how-to-tell-when-external-swf-loaded


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 5. Re: Blank Movie Clip
                Damon Edwards Level 3
                rather than using loadMovie, I'm suggesting that you use the MovieClipLoader class. The link I provided is the complete code that creates a blank movie clip and loads the swf into it. It allows you to do something while the swf is loading, and something once it has finished. So where you have your code, replace it with the script that can be found at the link, and change mcLoader.loadClip("swfName.swf", container); to mcLoader.loadClip("PageSwfName.swf", container);
                • 6. Re: Blank Movie Clip
                  akittymom
                  The code that is referred to says it is in AS2. What would the code be for AC3?
                  • 7. Re: Blank Movie Clip
                    Level 7
                    akittymom,

                    > The code that is referred to says it is in AS2. What would the code be for
                    > AC3?

                    Different beast altogether. You don't even need a movieclip for that.

                    var loader:Loader = new Loader();
                    loader.load(new URLRequest("somefile.swf"));
                    addChild(loader);

                    That's minimal code, comparable to the MovieClip.loadMovie() example
                    shown earlier in the thread. If you want to listen for a complete even --
                    meaning, if you want to know when the SWF has loaded -- you'll have to add
                    an event listener:

                    var loader:Loader = new Loader();
                    loader.load(new URLRequest("somefile.swf"));
                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
                    addChild(loader);

                    function completeHandler(evt:Event):void {
                    trace("Your content, she is loaded!");
                    }


                    David Stiller
                    Co-author, Foundation Flash CS3 for Designers
                    http://tinyurl.com/2k29mj
                    "Luck is the residue of good design."


                    • 8. Re: Blank Movie Clip
                      scharlton22 Level 1
                      thanks everyone, i love this forum!!