Draggable TextField - AS 2.0, Flash 8

Hi!

I am working on a web-based web application that allows the user to add images and textfields to the movie, and also allows them to drag the images and textfields to desired positions in the movie.

I have no problem adding the images (I create each image within a MovieClip, and then do startDrag and stopDrag on the mouse events.), but am unable to get the TextFields to work. I can add a textfield to the movie easily, I just can’t figure out how to allow the user to move it.

I’ve tried doing a startDrag directly on the TextField. This didn’t work.

I tried placing the TextField in a movieclip as follows:

ExternalInterface.addCallback(“setText1”, this, setText1);
function setText1():Void {
this.createEmptyMovieClip(“mTextHolder1”, -3050)
mTextHolder1.createTextField(“mText1”, -3051, 100, 100, 100, 100);
mText1.text = “Widget!”;
}
mTextHolder1.onPress = function() {
startDrag(this);
}
mTextHolder1.onRelease = function() {
stopDrag();
}

This adds the text to the movie, but it still does not allow me the user to move the textfield.

Any suggestions?

  • Mikeymac