0

if (child is WinCRLFTextArea) { var node:XML;

                        node = <{child.name}>{WinCRLFTextArea(child).text}</{child.name}>;
                        textXML.appendChild(node);
                    }

I want to add an attribute like "beginIndex" and "endIndex" to node element. dynamically i need to assign values to this attributes. ex: beginIndex = WinCRLFTextArea(child).text.length is it possible ? please anyone help me out for this.

Thanks in advance.

4

1 回答 1

1

您可以使用“@”运算符添加/编辑/读取属性。

var myXML:XML = <xml> <some> <node/> </some> </xml>;

myXML.some.node.@beginIndex = "1";

trace( myXML.some.node.@beginIndex ); // output: 1;
于 2013-08-08T07:56:20.837 回答