5 Replies Latest reply on Sep 29, 2006 9:32 AM by crazyjoemilan

    easy question

    crazyjoemilan Level 2
      So I've used work-arounds with the intent of learning the proper format, but I've not run into the solution on my own.

      When you load an MC, and that mc references _root, it then references the above mc. (correct me if I'm wrong). When you use a loadVars, onLoad function() { //crap }. your function is inside of the variable you're loadaing the new data into. For some reason, this._parent.whatever doesn't take me back to the _root even if the loadVars was created on the _root index. The only way I've found around it is to use _root, which brings me back to the fact that if I need to loadMovie() that mc, I run into problems. Make sense? Any help?

      The Mighty Republic of Helpy.
        • 1. Re: easy question
          TimSymons Level 1
          _root refers to the top most movie of the current level that you are programming in. (_level0 the _root == _level0) (_level1 then _root == _level1)

          when you do something like this:

          mc.onLoad = function() {
          // Then your scope inside here is for mc. That means that the keyword "this" refers to mc and that if you used: this._parent it will take you to the parent (or container of the mc object. If the parent is the main timeline then _root and this._parent will be the samething.

          • 2. Re: easy question
            crazyjoemilan Level 2
            yeah, I must be doing something else wrong then, because this._parent isn't referencing what it should.

            • 3. Re: easy question
              TimSymons Level 1
              Is your object inside another movieclip? For example, if you have a mc1 on the main timeline and then mc2 inside of mc1. Then inside mc2 the following will be true:

              this == mc2;
              this._parent == mc1;
              this._parent._parent == _root;

              • 4. Re: easy question
                Rothrock Level 5
                Sometimes I get confused as to where Flash is. (I was going to say where Flash thinks it is, but it always knows where it is – even when I don't!)

                So when I have a problem like this I add a line right before:

                trace("The current scope is: "+this);
                trace("The parent is: "+this._parent);

                Sometimes it just clears up a lot. Sometimes it doesn't.
                • 5. Re: easy question
                  crazyjoemilan Level 2
                  trace()! Why didn't I think of that (slaps forehead). Thanks.