2 Replies Latest reply on May 7, 2007 3:56 PM by pajaroplus

    hitTest

    BigdaddyVELTRI
      If hitTest value in createTextField is == to true.
      When the value is true I want it to do something. It's not working for me. Here's my code.

      this.createTextField("status_txt", 999, 10, 10, 100, 22);
      logotop.onEnterFrame = function() {
      status_txt.text = this.hitTest(addresstop);
      }
      if(status_txt == "true"){
      getURL(" http://www.promomart.com");
      }
        • 1. Re: hitTest
          mercl Level 1
          try,

          if (status_text.hitTest(_root._xmouse, _root._ymouse, true)) {
          trace("HIT!");
          }

          although i don't know if you can detect hit on a dynamic textfield

          also use if (status_txt == true) (no " " since its a boolean )
          or, even more elegant if (status_txt) {

          • 2. Re: hitTest
            pajaroplus Level 1
            (status_txt == "true")

            this will never happen, since:

            status_txt = "[Object TextField]"

            So the problem probably is that you are looking for:

            logotop.onEnterFrame = function() {
            var hitting = this.hitTest(addresstop);
            status_txt.text = hitting
            if (hitting){
            getURL(" http://www.promomart.com");
            }
            }