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 ); } } }
Related Scripts with Example Source Code in same category :