Groups | Blog | Home
all groups > flash actionscript > july 2007 >

flash actionscript : loadMovie XML problem ( _root, _parent or this ???)



DMennenoh **AdobeCommunityExpert**
7/10/2007 3:20:00 PM
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/

pinheirobr
7/10/2007 7:47:01 PM
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[i].nodeName == "cal") {
if ((arrCal[i].attributes.yearID == myNewYear) and
(arrCal[i].attributes.monthID == myNewMonth)) {
arrDate = arrCal[i].childNodes;
for (j=0; j<=arrDate.length; j++) {
if (arrDate[j].nodeName == "date") {
diaryDate = arrDate[j].attributes.id;
myDiary = _root["Numbers" + diaryDate];
myDiary.gotoAndStop (3);
arrMsg = arrDate[j].childNodes;
for (k=0; k<=arrMsg.length; k++) {
if (arrMsg[k].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[i].nodeName == "cal") {
if ((arrCal[i].attributes.yearID == msgYear) and (arrCal[i].attributes.monthID
== msgMonth)) {
arrDate = arrCal[i].childNodes;
for (j=0; j<=arrDate.length; j++) {
if (arrDate[j].nodeName == "date") {
if (arrDate[j].attributes.id == msgDate) {
arrMsg = arrDate[j].childNodes;
for (k=0; k<=arrMsg.length; k++) {
if (arrMsg[k].nodeName == "msg") {
pointNum += 1;
_root.mc_msgtxt.txt_msg += pointNum+ ". " + arrMsg[k].firstChild.nodeValue +
newline;
}
}
}
}
}
}
}
}
}
}




:confused;
pinheirobr
7/10/2007 9:07:27 PM
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.

[b]I sent the code for your email. [/b]
If you will be able to help me. I will be very thanked.

THANK YOU VERY MUCH !!!!

Leonardo


AddThis Social Bookmark Button