Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-22-2001, 10:19 AM   #1
mad_A
The Zen of ActionScript
 
mad_A's Avatar
 
Join Date: Mar 2001
Location: Dublin, Ireland
Posts: 713
Unhappy

Hi,
I am trying to read from an external XML file into a movie. This is fine for text fields on the main timeline but will not work for bringing it into text fields within movie instances. Any idea how I can do this?
The code I am using at the moment is...
LPXML = new XML();
LPXML.load("LPtest.xml");
function populateTextFields () {
DisposableXML = new XML();
TempXML = new XML();
ClickList = new Array();
DisposableList = new Array();
ClickList = LPXML.firstChild.childNodes;
i = 0;
while (i<=ClickList.length) {
if (ClickList[i].nodeName.toLowerCase() == "click") {
DisposableXML = ClickList[i];
DisposableList = DisposableXML.childNodes;
ii = 0;
while (ii<=DisposableList.length) {
TempXML = DisposableList[ii];
if (DisposableList[ii].nodeName.toLowerCase() == "lptitle") {
lptitle = lptitle +"<font type=\"Arial\" size=\"13\" color=\"#000000\"><b>"+DisposableList[ii]+"</b></font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text1") {
text1 = text1+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text2") {
text2 = text2+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text3") {
text3 = text3+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text4") {
text4 = text4+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text5") {
text5 = text5+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text6") {
text6 = text6+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "text7") {
text7 = text7+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "weblink1") {
WebLink1 = TempXML.firstChild.nodeValue ;
} else if (DisposableList[ii].nodeName.toLowerCase() == "qintro") {
questionintro = questionintro+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "questionstem") {
questionstem = questionstem+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "questionprompt") {
questionprompt = questionprompt+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "partlyright") {
partlyright = partlyright+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "incorrect") {
incorrect = incorrect+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "correctfeedback") {
correctfeedback = correctfeedback+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "cancel") {
cancel = cancel+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
} else if (DisposableList[ii].nodeName.toLowerCase() == "option1") {
_root.option1.option1 = _root.option1.option1+"<font type=\"Arial\" size=\"12\" color=\"#000000\">"+DisposableList[ii]+"</font>";
}

ii = Number(ii)+1;
}
}
i = Number(i)+1;
}
}
LPXML.onLoad = populateTextFields;

_________

the option1.option1 at the bottom is the instace of ooption1 with a text field called option1 within it. All the rest work fine. Just not to the internal text field.

Thanks!
mad_A is offline   Reply With Quote
Old 03-22-2001, 03:20 PM   #2
mad_A
The Zen of ActionScript
 
mad_A's Avatar
 
Join Date: Mar 2001
Location: Dublin, Ireland
Posts: 713
Thumbs up got it sorted!

Yes, I am replying to myself!
Just in case anyone has the same problem.
What I did to get it to work was bring in the text for option1 onto the main timeline like all the other variables, and then bring it into the movie from within the movie with
option1 = _root.option1;

Can't believe I didn't try that sooner.
If anyone has a better way of doing it I'd love to hear.
regards
mad_A is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
removeMovieClip() not work for components? djandrew Components 30 08-03-2007 04:51 PM
Movie clips that won't act like buttons! guytrenzich ActionScript 2.0 6 06-24-2007 09:39 PM
unloading multiple movie clips asprinwizard ActionScript 2.0 2 06-08-2006 02:21 PM
Skinning components with embedded components epeace Components 5 06-16-2005 08:35 PM
Movie Clips Order Luigi Vercotti ActionScript 1.0 (and below) 2 02-27-2004 10:32 AM


All times are GMT. The time now is 10:08 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.