Although it seems in reverse order, the last thing that we need to do is create the text field in the onClipEvent (mouseUp) handler, along with setting the value of textexists to true once the cursor is clicked on the canvas while the text tool is active:
if(_root.isactive=="texttool"){
if(_root.textexists==false){
_root.drawing.createTextField("textname",0,35,25,635,500);
_root.drawing.textname.variable="typedtext";
_root.drawing.textname.textColor=_root.txtcolor;
_root.drawing.textname.type="input";
_root.drawing.textname.border=false;
_root.drawing.textname.multiline=true;
_root.drawing.textname.wordWrap=true;
_root.drawing.textname.text="Your default message.
_root.textexists=true;
}
}
This uses the function createTextField with parameters defined as a string for the name of the text field, the layer, the starting x position, starting y position, width, and height. Mine is set to cover my entire workable canvas area.


