volxn
06-12-2005, 12:42 AM
setup:
i have the XML file "menu.xml"
which contains this code:
<?xml version="1.0"?>
<Menu>
<item>one</item>
<item>two</item>
<item>three</item>
</Menu>
and here's my as-code:
_root.menuxml = new XML();
_root.menuxml.load("menu.xml");
_root.menuxml.ignoreWhite = true;
_root.menuxml.onLoad = function ()
{
for (a = 0; a < _root.menuxml.firstChild.childNodes.length; a++)
{
_root.createTextField("m" + a, _root.getNextHighestDepth(), a*100, 10, 100, 20);
_root.eval("m" + a).type = "dynamic";
_root.eval("m" + a).background = true;
_root.eval("m" + a).backgroundColor = 0xFFFFFF;
_root.eval("m" + a)._x = a * 50;
_root.eval("m" + a)._y = 20;
_root.eval("m" + a)._alpha = 100;
_root.eval("m" + a).html = true;
_root.eval("m" + a)._visible = true;
_root.eval("m" + a).htmlText = _root.menuxml.firstChild.childNodes[a].firstChild;
}
};
the above code is in the frame code of the movieclip "mainmenu"
basically, i want the mainmenu to load the <item>s from the xml and output their contents across the menu at the top.
now, there really isnt any problem reading and loading the XML file, cuz i added
trace(_root.menuxml.firstChild.childNodes[a].firstChild);
within that for () {} loop and it outputted the correct stuff
however, its displaying the textfields which is really getting me, cuz they dont display!!!!
i know it creates the textfields in the correct spots, but when i highlight where i get the text-edit cursor, there's no text!!
here's the website for the thing im talking about: http://volxn.byethost33.com/main.php (the menu is supposed to be the dark bar at the top; if you move your cursor toward its left, youll get the text-editting cursor, but when you move it to the right, you get the mouseover _alpha effect)
if anyone has any solutions, id very much appreciate it!
also, if anyone could somehow make it use dynamically created movieclips instead of textfields, thatd rock too!
thanx so much!!
_xn
i have the XML file "menu.xml"
which contains this code:
<?xml version="1.0"?>
<Menu>
<item>one</item>
<item>two</item>
<item>three</item>
</Menu>
and here's my as-code:
_root.menuxml = new XML();
_root.menuxml.load("menu.xml");
_root.menuxml.ignoreWhite = true;
_root.menuxml.onLoad = function ()
{
for (a = 0; a < _root.menuxml.firstChild.childNodes.length; a++)
{
_root.createTextField("m" + a, _root.getNextHighestDepth(), a*100, 10, 100, 20);
_root.eval("m" + a).type = "dynamic";
_root.eval("m" + a).background = true;
_root.eval("m" + a).backgroundColor = 0xFFFFFF;
_root.eval("m" + a)._x = a * 50;
_root.eval("m" + a)._y = 20;
_root.eval("m" + a)._alpha = 100;
_root.eval("m" + a).html = true;
_root.eval("m" + a)._visible = true;
_root.eval("m" + a).htmlText = _root.menuxml.firstChild.childNodes[a].firstChild;
}
};
the above code is in the frame code of the movieclip "mainmenu"
basically, i want the mainmenu to load the <item>s from the xml and output their contents across the menu at the top.
now, there really isnt any problem reading and loading the XML file, cuz i added
trace(_root.menuxml.firstChild.childNodes[a].firstChild);
within that for () {} loop and it outputted the correct stuff
however, its displaying the textfields which is really getting me, cuz they dont display!!!!
i know it creates the textfields in the correct spots, but when i highlight where i get the text-edit cursor, there's no text!!
here's the website for the thing im talking about: http://volxn.byethost33.com/main.php (the menu is supposed to be the dark bar at the top; if you move your cursor toward its left, youll get the text-editting cursor, but when you move it to the right, you get the mouseover _alpha effect)
if anyone has any solutions, id very much appreciate it!
also, if anyone could somehow make it use dynamically created movieclips instead of textfields, thatd rock too!
thanx so much!!
_xn