PDA

View Full Version : Action Script on SWF



ahlimosa
12 Feb 2008, 04:08 AM
I got this and get result in single-line.
I want it one by one like the following:

1234

1234

1234

1234



Here is the code I am using:

function menu()
{
pathID = _xml.idMap.menu;
total = pathID.childNodes.length;
_root.m_arr = [];
while (i < total)
{
mcx = attachMovie("MenuM", "btn" + i, i);
mcx.textM._text = "<font color=\'#990000\'></font>" + pathID.childNodes[i].attributes.btnName;
mcx._i = i;
set("btn" + i + ".p", pathID.childNodes[i].attributes.p);
set("btn" + i + "._textH", pathID.childNodes[i].attributes.btnName);
mcx.textM.textT.autoSize = true;
j = i - 1;
this["btn" + i]._x = Math.floor(this["btn" + j]._x + (this["btn" + j]._width + 10));
mcx.mbg._width = mcx.textM._width;
mcx.btn._width = mcx.mbg._width;
++i;
} // end while
} // End of the function
_xml = new XML();
_xml.load("dat/xml/xmlx.xml");
_xml.ignoreWhite = 1;
_xml.onLoad = function (ok)
{
if (ok)
{
menu();
setStage();
_root.p = "15";
_root.Menu_xml.btn0.gotoAndStop(10);
_root.Menu_xml.btn0.mbg.gotoAndStop(10);
_root.Menu_xml.btn0.btn.enabled = false;
_root.m_numb = "0";
}
else
{
trace ("XML not loaded");
} // end else if
};
i = 0;

ahlimosa
17 Feb 2008, 10:38 PM
can anyone help???