my_xml = new XML();
my_xml.ignoreWhite = 1;
backbut.addEventListener(MouseEvent.CLICK, gotoFrame1);
ship1.addEventListener(MouseEvent.CLICK, my_function);

function gotoFrame1(event:MouseEvent):void

function my_function(event:MouseEvent)
text_field_1.text = my_xml.firstChild.childNodes[0].attributes.Built_in;
text_field_2.text = my_xml.firstChild.childNodes[0].attributes.Date_of_Loss;
text_field_3.text = my_xml.firstChild.childNodes[0].attributes.Type_of_loss;
text_field_4.text = my_xml.firstChild.childNodes[0].attributes.Cargo;
text_field_5.text = my_xml.firstChild.childNodes[0].attributes.Loss_of_Life;
text_field_6.text = my_xml.firstChild.childNodes[0].attributes.Type_of_ship;
text_field_7.text = my_xml.firstChild.childNodes[0].attributes.Vessel_Name;
text_field_8.text = my_xml.firstChild.childNodes[0].attributes.Detail;


This code is from frame 2 on the timeline the back buton works and brings the user back to frame 1.The problem is when i add the xml code .The whole timeline just keeps looping and none od the data is displayed.It gives me a ReferenceError: Error #1065: Variable TCMText is not defined.If i use this code in a blank file with they dynamic textboxes it works.I am creating a map game where if you click the white buttons all the information displays from an xml data file i created in excel.