Search code examples
xmlactionscript-3e4x

Creating a new attribute in an XML node using E4X in AS3


Is there any way to do it?


Solution

  • Thanks for answering.

    I did found your explanations and link suggestions interesting and encouraging.

    Anyway, I did not make myself clear with my question. What I did want to know was how to create any property, even without knowing it's name. I did read several docs and tutorials until I figured it out. Hope this can be of help.

    var data:XML = <node/>;
    var $my_attr:String = 'id';
    data.@[$my_attr] = 'foo';