Mega Code Archive

 
Categories / Flash ActionScript / XML
 

Use the dot operator ( ) on the XML instance and add the element

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var example:XML = <example />;         // Create a new XML node named newElement and add it to the example instance         example.newElement = <newElement />;         trace( example );     }   } }