So I am a pretty novice flash user, so I am not really sure what is going on. I’m using flash 8 and when I test on my computer it is fine but as soon as I upload the swf, the xml no longer loads. Here is the as I am using.
// DisplayInfo is used when an item is pressed
// it hides the menu_mc (and the buttons) and shows the
// infobox_mc, assigning the text of the selected button
// to the textbox within.
function DisplayInfo(){
menu_mc._visible = false;
infobox_mc._visible = true;
infobox_mc.description_txt.htmlText = this.description_text;
}
// close_btn is in infobox_mc ands restores
// the menu (clearing the info text and hiding itself as well)
infobox_mc.close_btn.onRelease = function(){
menu_mc._visible = true;
infobox_mc._visible = false;
infobox_mc.description_txt.htmlText = "";
}
function DLFunc(param){
trace(param);
getURL(param);
};
infobox_mc._visible = false; // start the info box hidden
// define basic variables for setting up the menu
var item_spacing = 28; // how far menu items are spaced veritcally
var item_count = 0; // counts menu items as they are added from the XML
// CreateMenu creates a menu based on the XML object passed.
// It loops through all the items with a for loop adding clips to the menu_mc
// movieclip on the timeline, defining the appropriate text where needed
function CreateMenu(menu_xml){
// start with the first item in the XML
var items = menu_xml.firstChild.childNodes[0].childNodes; // menu -> menuitems -> child nodes array
for (var i=6; i<items.length; i++) {
// only continue if the type of this item is a aticle
if (items*.attributes.type == item) {
// create variables for our elements
var pubDate = items*.childNodes[1]; // same as items*.childNodes[0]
var description = items*.childNodes[3]; // second child node
// Create a menu item movie clip in the menu_mc instance on the main timeline
// for each item element offsetting each additional further down the screen
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
item_mc._y = item_count * item_spacing;
item_count++;
// assign text using nodeValue to get the text
// from the text nodes and CDATA sections
item_mc.pubDate_txt.htmlText = pubDate.firstChild.nodeValue;
item_mc.main_btn.description_text = description.firstChild.nodeValue;
// set the onRelease of the item button to the DisplayInfo function
item_mc.main_btn.onRelease = DisplayInfo;
}
}
}
// CreateMenu2 uses nextSibling and a do-while loop to
// access all the items in the XML. It functions exactly the
// same as CreateMenu, just with a different technique (NOT USED)
function CreateMenu2(menu_xml){
// start with the first item in the XML
var currItem = menu_xml.firstChild.firstChild.firstChild; // menu -> menuitems -> first item
do {
// only continue if the type of this item is a squirrel
if (items*.attributes.type == "pubDate") {
// create variables for our elements
var pubDate = currItem.firstChild;
var description = pubDate.nextSibling;
// Create a menu item movie clip in the menu_mc instance on the main timeline
// for each item element offsetting each additional further down the screen
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
item_mc._y = item_count * item_spacing;
item_count++;
// assign text using nodeValue to get the text
// from the text nodes and CDATA sections
item_mc.pubDate_txt.htmlText = pubDate.firstChild.nodeValue;
item_mc.main_btn.description_text = location.firstChild.nodeValue;
// set the onRelease of the item button to the DisplayInfo function
item_mc.main_btn.onRelease = DisplayInfo;
}
} while (currItem = currItem.nextSibling); // continue loop if more items exist after current
}
// manage XML
// create new XML object instance, remembering to ignore white space
var atmosphere_xml = new XML();
atmosphere_xml.ignoreWhite = true;
// define an onLoad to create our location menu when the XML has successfully loaded.
atmosphere_xml.onLoad = function(success){
if (success) CreateMenu(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load the xml file!
atmosphere_xml.load("http://www.feed43.com/atmospheredates.xml");
you can view the non working file at http://www.rmory.com/tour/news3.swf
any hints as to how to make this work would be appreciated. Thanks!