Hi guys, i’ve been trying to play around with the squirrel finder tutorial code to make it so that once you click on the squirrel’s name, it will load a new swf file instead of displaying additional content.
the coding i’m using is working fine, the only thing that isnt working is the .onRelease
no matter how many buttons i include in the XML file, all buttons manifested will try to load up the same swf.
this is the coding i’m working with.
//INITIALIZE
var _xml = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = function(success){
if (success) {
reelsROOT= _xml.idMap["reels"];
_reelsTitle.text = reelsROOT.attributes.h;
CreateMenu(this);
}
else trace("Error loading XML file");
}
_xml.load("test.xml");
//MENU
function CreateMenu(menu_xml){
var item_spacing = 120;
var item_count = 0;
var datacount = menu_xml.idMap["reels"].childNodes;
var items = reelsROOT.childNodes;
for (var i=0; i<datacount.length; i++) {
var reelinfo = items*.childNodes[0].childNodes;
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
item_mc.reelURL = items*.childNodes[1].childNodes;
trace(item_mc.reelURL);
item_mc._x = item_count * item_spacing;
item_count++;
item_mc.reel_txt.text = reelinfo;
item_mc.main_btn.onRelease = function() {
**loadMovieNum(item_mc.reelURL, 4);**
}
}
}
my xml file looks somewhat like this:
<xml>
<Sections id="reels" h="REELS">
<data>
<title>REEL01</title>
<src>clips/01.swf</src>
</data>
<data>
<title>REEL02</title>
<src>clips/02.swf</src>
</data>
<data>
<title>REEL03</title>
<src>clips/03.swf</src>
</data>
</Sections>
</xml>
So using this code, the 3 buttons are created just fine. when i trace into to item_mc.reelURL they trace perfectly, showing all 3 different swf paths. it’s just upon CLICKING the button, ALL of the buttons ONLY point to (clips/03.swf)
any suggestions, guys?
Thanks a bunch