1 Reply Latest reply on Oct 3, 2006 11:03 AM by Newsgroup_User

    SImple Problem

    indigomontoya Level 1
      on (release) {
      var map = map_txt;
      if(map == "map1"){
      trace("worked");
      }
      }

      ok thats pretty simple, i had a lot more going on but it wasnt working and i traced it back to this, and i cant for the life of me figure out why. The trace section is just for testing the logic. there is an input text box on the stage labeled map_txt
        • 1. Re: SImple Problem
          Level 7

          "indigomontoya" <webforumsuser@macromedia.com> wrote in message
          news:efu6su$jef$1@forums.macromedia.com...
          > on (release) {
          > var map = map_txt;
          > if(map == "map1"){
          > trace("worked");
          > }
          > }
          >
          > ok thats pretty simple, i had a lot more going on but it wasnt working and
          > i
          > traced it back to this, and i cant for the life of me figure out why. The
          > trace
          > section is just for testing the logic. there is an input text box on the
          > stage
          > labeled map_txt
          >

          When you are using the on(release) like you are above, you are dealing in
          the scope of the MovieClip the actions are attached to. So, try changing
          to:

          on(release) {
          trace("map_txt is = " + map_txt);
          trace("This Clip is " + this);
          trace("Parent Clip is " + this._parent);
          }

          see what the traces are. Most likely map_txt will be undefined because it
          is probably not in the same scope. If it traces undefined, try changing to
          this._parent.map_txt.

          Also, if you want to reference the actual text in the text field, then you
          need to either have the variable name for the text field be map_txt or
          reference the text by using map_txt.text.