all groups > flash actionscript > december 2004 >
You're in the

flash actionscript

group:

clicking on dynamic text field to select


clicking on dynamic text field to select Andy Petroski
12/16/2004 11:54:35 PM
flash actionscript:
How do I program a dynamic text field so that if it's clicked on I can get
the text and/or the line number that's clicked. I'm familiar with doing
this in Director, but can't find a good way to get started in Flash.

Thanks for any info you can give me.

Windows XP
Flash MX

Re: clicking on dynamic text field to select kglad
12/17/2004 6:36:09 AM
_root.onMouseDown = function() {
Selection.setFocus(tbox); // tbox is instance name of your textfield
};
_root.onMouseUp = function() {
Selection.getBeginIndex(); // if>-1, text has been selected
Selection.getEndIndex()); // ditto
};
Re: clicking on dynamic text field to select kglad
12/17/2004 6:36:43 AM
Re: clicking on dynamic text field to select Andy Petroski
12/17/2004 2:08:28 PM
Thanks. I'm getting the -1 indicating that I've clicked on text, but how do
I get the text or the line of text that has been clicked?

Thanks.

[quoted text, click to view]

Re: clicking on dynamic text field to select kglad
12/18/2004 2:16:46 AM
if tbox is the instance name of your textfield then:


AddThis Social Bookmark Button