TDOT Blog Touchwood Creative

Register | Forgot password?


Touchwood is continuing to grow!

We are looking for talented Flex developers to join our Interactive Group. If you have any interest we would love to meet you. Please email your resume to us at:

jobs@touchwoodcreative.com


Can I append recoeds to an XML file?

Based on your codes, I try to append codes to an XML file,but it shows"Error #1009: Cannot access a property or method of a null object reference.",
Could you please have a look?

=============================================================
private function appendXML():void{
myButtonInfo.buttonID=BtnID.text;
myButtonInfo.xPosition=xPos.text;
myButtonInfo.yPosition=yPos.text;
myButtonInfo.bWidth=bW.text;
myButtonInfo.bHeight=bH.text;
myButtonInfo.action=bA.text;
var newXMLStr:String="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+myButtonInfo.toXMLString();
var fs:FileStream=new FileStream();
fs.open(file,FileMode.APPEND);
fs.writeUTFBytes(newXMLStr);
fs.close();
}

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

© Touchwood Creative 2007 | We use Firefox