I have this code to start typing where I click the cursor on a movieclip:
_root.note.postit.onPress = function() {
xpos = _xmouse;
ypos = _ymouse;
_root.createTextField("my_txt", 1, xpos, ypos,(500-xpos),10);
my_txt.autoSize= true;
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.type = "input";
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_txt.setTextFormat(my_fmt);
Selection.setFocus(_root.my_txt);
}
This works fine. But now I am trying to contain the new text field within a movieclip by doing something like this:
_root.note.postit.onPress = function() {
xpos = _xmouse;
ypos = _ymouse;
_root.note.createTextField("my_txt", 1, xpos, ypos,(500-xpos),10);
_root.note.my_txt.autoSize= true;
_root.note.my_txt.multiline = true;
_root.note.my_txt.wordWrap = true;
_root.note.my_txt.type = "input";
var my_fmt:TextFormat = new TextFormat();
_root.note.my_fmt.color = 0xFF0000;
_root.note.my_txt.setTextFormat(my_fmt);
Selection.setFocus(_root.note.my_txt);
}
This doesn’t work. Whats going wrong? Any help greatly appreciated.
Thanks