I have a text area that is populated with the contents of an XML document. I'm trying to get the node that the user has placed his cursor in.
I can easily get the row and column or the index of the cursor. I can also create an XML object via
What would be great is if there is a
XML.getNodeAtPosition(row, column) method.
Here is example code:
var row:int = 100; var column:int = 10; var xmlText:String = fileLoader.data as String; textarea.text = xmlText; textarea.setAnchor(row, column); // simulate user cursor var xml:XML = new XML(textarea.text); var node:XML = xml.getNodeAt(row, column);
The XML may be edited by the user and may not be valid XML. I don't think Flash will create an XML object unless it is completely valid but it would be great if it was possible.