Hi everybody,
I have a Flash movie that uses a combobox, a list, and a textarea components. I have created the code to load all the information from XML files.
The funny thing is that when I play the movie by itself in an Internet browser, It loads everything fine, as you can see HERE
But when I try to load the same movie inside another movie, the components don’t work, as you can see HERE
Here is the code I am using. Is it something wrong with it?
Thanks a lot.
_global.style.setStyle("themeColor", "haloOrange");
open_pb.setStyle("fontWeight","bold");
//
var menu_xml:XML = new XML ();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function (success) {
combo_cb.addItem ("Select a topic", "");
test (this);
};
//menu_xml.load ("image_urls.xml");
menu_xml.load ("topics.xml");
function test (node_xml) {
rootElement_xml = node_xml.firstChild;
for (i = 0; i < rootElement_xml.childNodes.length; i++) {
child_xml = rootElement_xml.childNodes*;
combo_cb.addItem (child_xml.firstChild.firstChild.nodeValue, child_xml.lastChild.firstChild.nodeValue);
}
}
///////////
description_ta.html = true;
///////////
var description_lv = new LoadVars ();
description_lv.onData = function (raw_text) {
description_ta.text = raw_text;
};
///XML OBJECT
var samplesXML:XML = new XML ();
samplesXML.ignoreWhite = true;
samplesXML.onLoad = loadXML;
/////////////////////////////////////
function loadXML (loaded) {
if (loaded) {
xmlNode = this.firstChild;
name = [];
description = [];
url = [];
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++) {
name* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
url* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
urls_list.addItem (name*, url*);
urls_list.iconFunction=function(item:Object):String{
return "symbolWWW";
}
}
var hagar:Object = new Object ();
hagar.change = function (evt) {
for (j = 0; j < name.length; j++) {
if (evt.target.getValue () == url[j]) {
description_lv.load (description[j]);
}
}
};
urls_list.addEventListener ("change", hagar);
} else {
trace ("file not loaded!");
}
}
var hillel:Object = new Object ();
hillel.change = function (evt) {
if (evt.target.getValue () != "") {
urls_list.removeAll ();
samplesXML.load (evt.target.getValue ());
}
};
combo_cb.addEventListener ("change", hillel);
var oListener:Object = new Object ();
oListener.click = function (oEvent:Object) {
getURL (urls_list.value, "blank");
};
open_pb.addEventListener ("click", oListener);