Skip to main content
Participant
July 10, 2007
Question

loadMovie XML problem ( _root, _parent or this ???)

  • July 10, 2007
  • 1 reply
  • 191 views
I am having problems loading an xml file from an swf. I have a dynamic calendar that I am using. I am loading the calendar.swf inside my parent.swf using the ; loadMovie("calendar.swf", "loadstage"); I have worked out all issues except the xml file that the calendar.swf calls for is not loading. It works fine when the swf is published on its own.
I does not work when the swf is loaded in the parent.swf.

HELP ME, PLEASE !!!!! THANK YOU VERY MUCH!!!!


THE ACTION SCRIPT !!!

XMLData = new XML();
XMLData.load("cal.xml");
XMLData.onload = viewApp;
function viewApp () {
mainTag = new XML();
arrCal = new Array();
arrDate = new Array();
arrMsg = new Array();
mainTag = this.firstChild.nextSibling;
if (mainTag.nodeName.toLowerCase() == "diary") {
arrCal = mainTag.childNodes;
for (i=0; i<=arrCal.length; i++) {
if (arrCal .nodeName == "cal") {
if ((arrCal
.attributes.yearID == myNewYear) and (arrCal .attributes.monthID == myNewMonth)) {
arrDate = arrCal
.childNodes;
for (j=0; j<=arrDate.length; j++) {
if (arrDate.nodeName == "date") {
diaryDate = arrDate.attributes.id;
myDiary = _root["Numbers" + diaryDate];
myDiary.gotoAndStop (3);
arrMsg = arrDate.childNodes;
for (k=0; k<=arrMsg.length; k++) {
if (arrMsg.nodeName == "msg") {
}
}
}
}
}
}
}
}
}



function dispMsg (msgYear, msgMonth, msgDate) {
_root.mc_msgtxt.txt_msg = "";
pointNum = 0;
msgYear = _root.MyNewYear;
msgMonth = _root.MyNewMonth;
msgDate = _root.clickedDate;
mc_ViewClickedDate.viewClickedDate = msgDate + " " + MonthNames[msgMonth] + " " + msgYear
if (mainTag.nodeName.toLowerCase() == "diary") {
arrCal = mainTag.childNodes;
for (i=0; i<=arrCal.length; i++) {
if (arrCal .nodeName == "cal") {
if ((arrCal
.attributes.yearID == msgYear) and (arrCal .attributes.monthID == msgMonth)) {
arrDate = arrCal
.childNodes;
for (j=0; j<=arrDate.length; j++) {
if (arrDate.nodeName == "date") {
if (arrDate.attributes.id == msgDate) {
arrMsg = arrDate.childNodes;
for (k=0; k<=arrMsg.length; k++) {
if (arrMsg.nodeName == "msg") {
pointNum += 1;
_root.mc_msgtxt.txt_msg += pointNum+ ". " + arrMsg.firstChild.nodeValue + newline;
}
}
}
}
}
}
}
}
}
}




This topic has been closed for replies.

1 reply

Inspiring
July 10, 2007
You are referencing _root, which is not good practice. The movie loading
your xml loader becomes root...

but you can likely fix your issue by placing

this._lockroot = true;

in the first frame of your loaded movie.

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Participant
July 10, 2007
Thank You Dave !!!

But I already placed this line of code in the first frame of my loaded movie.

this._lockroot = true;

This fixed the picture that is loaded from the XML.

The events that are not being loaded for the corresponding dates.

I sent the code for your email.
CAN YOU HELP ME ??? PLEASE !!!

THANK YOU VERY MUCH !!!!

Leonardo