3 Replies Latest reply on Jan 23, 2008 7:45 AM by Newsgroup_User

    How the heck do you move the clip?

    ooba Level 1
      Frusterated.
      moveTo() not working and resizing does not stretch text.

      What gives?


      // THE FORMAT FOR TEXT FIELD
      var my_fmt:TextFormat = new TextFormat();
      my_fmt.color = 0xFFFFFF;
      my_fmt.size = 26;
      my_fmt.underline = true;

      // THE TEXT FIELD PAARENT MC
      var titleBox:MovieClip = this.createEmptyMovieClip( "titleBox", _root.getNextHighestDepth() );

      titleBox.createTextField("my_txt", 1000, 0, 0, 300, 50);
      titleBox.my_txt.multiline = true;
      titleBox.my_txt.wordWrap = true;
      titleBox.my_txt.border = true;
      titleBox.my_txt.text = _root.headline;
      titleBox.my_txt.setTextFormat(my_fmt);

      // try and move it
      titleBox.my_txt.moveTo(200, 100);

      trace('titleBox moveto = (' + Stage.width + '/2)-(' + titleBox.my_txt._width + '/2) = ' + ((Stage.width/2)-(titleBox.my_txt._width/2)) );
      titleBox.moveTo((Stage.width/2)-(titleBox.my_txt._width/2), 10);
        • 1. Re: How the heck do you move the clip?
          kglad Adobe Community Professional & MVP
          just assign the _x and _y properties of your textfield or your movieclip.
          • 2. Re: How the heck do you move the clip?
            ooba Level 1
            kglad,

            Thanks for pointing out that oversight.
            Movie Clips are positioned by the moveto() while the textfield is positioned via the _x, and _y.
            • 3. Re: How the heck do you move the clip?
              Level 7
              Hi ooba,

              Actually, moveTo is part of the drawing API. It's used to move the
              drawing cursor to a specific location without drawing. I don't believe
              moveTo has ever been used to move a movie clip (or any UI object for that
              matter). In ActionScript 2.0, you must update the "_x" and "_y" properties
              (as kglad pointed out), and in ActionScript 3.0 they're "x" and "y"
              respectively. Unless you have your own "moveto" method, you won't be able to
              use it to move anything, even movie clips.

              Regards,
              Patrick Bay
              BAY NEW MEDIA

              "ooba" <marshale@ctc.com> wrote in message
              news:fn7jj1$8u5$1@forums.macromedia.com...
              > kglad,
              >
              > Thanks for pointing out that oversight.
              > Movie Clips are positioned by the moveto() while the textfield is
              > positioned via the _x, and _y.