Hello, I think a loop is causing Flash Player to run slowly. Any help is much appreciated. Below is my script.
if (_url.substr(0, 4) != “http”)
{
_root.xmlRootURL = “xml/”;
_root.fileURL = “”;
_root.path = “”;
}
else
{
_root.xmlRootURL = “flash/main/xml/”;
fileURL = “flash/main/”;
_root.path = “flash/main/”;
} // end else if
mainFla = new Array();
mainFla = [“1.swf”, “2.swf”, “3.swf”, “4.swf”, “5.swf”];
produc1 = “main.swf”;
this.bar_mc.bar.productLoader.loadMovie(_root.fileURL + _root.produc1);
mainfla.setMask(imask);
Loadmain = function (num)
{
inum = num - 1;
mainfla.img.loadMovie(_root.fileURL + mainFla[inum]);
trace (_root.mainFla[inum]);
};
bar_mc.swapDepths(1000);
Loadmain(1);
System.useCodepage = true;
Stage.align = “LT”;
Stage.scaleMode = “noscale”;
linkUrl = new Array();
linkTarget = new Array();
xmlURL = _root.xmlRootURL + “main.xml”;
xmlRow = function (xml)
{
row = util.XmlManagement.row(xml.firstChild, “attributes”);
row1 = util.XmlManagement.row(xml.firstChild, “childnodes”);
str = xml.firstChild;
dataNum = row1.length;
for (var _loc4 in row)
{
row[_loc4] = util.XmlManagement.row(xml.firstChild.childNodes[_loc4], “attributes”);
row1[_loc4] = util.XmlManagement.row(xml.firstChild.childNodes[_loc4], “childnodes”);
linkUrl[_loc4] = new Array();
linkTarget[_loc4] = new Array();
var _loc3 = _loc4;
for (var _loc2 in row[_loc4])
{
linkUrl[_loc4][_loc2] = row[_loc4][_loc2].linkUrl;
linkTarget[_loc4][_loc2] = row[_loc4][_loc2].linkTarget;
} // end of for…in
} // end of for…in
};
this.onEnterFrame = function ()
{
if (xmlURL != undefined)
{
util.XmlManagement.xmlLoad(xmlURL, xmlRow, null, null);
delete this.onEnterFrame;
} // end if
};
campaign.onRelease = function ()
{
getURL("/one/two.jsp", “_self”);
};
var time2 = 0;
_l1 = this;
topMenu.onEnterFrame = function ()
{
++time2;
if (time2 % 3 == 0)
{
if (time2 > 30)
{
topPlay = true;
} // end if
if (_level.loginVal != undefined)
{
topPlay = true;
} // end if
if (topPlay == true)
{
topMenuView();
delete this.onEnterFrame;
} // end if
} // end if
};
topMenuView = function ()
{
topMenu._alpha = 100;
if (_level.loginVal == “true”)
{
topMenu.gotoAndStop(3);
}
else
{
topMenu.gotoAndStop(2);
} // end else if
};
changeStateMc = function (mc, prop, startVal, endVal, durationVal)
{
var _loc1 = new mx.transitions.Tween(mc, prop, mx.transitions.easing.Strong.easeOut, startVal, endVal, durationVal, false);
};
bar_mc.bar.bar2._alpha = 0;
changColor = function (sel)
{
bar_mc.bar.productLoader.changPro(sel);
if (sel == 1)
{
isel = 2;
}
else
{
isel = 1;
} // end else if
bar_mc.bar[“bar” + sel]._visible = true;
bar_mc.bar[“bar” + isel]._visible = true;
bar_mc.bar.onEnterFrame = function ()
{
changeStateMc(bar_mc.bar[“bar” + sel], “_alpha”, bar_mc.bar[“bar” + sel]._alpha, 100, 10);
changeStateMc(bar_mc.bar[“bar” + isel], “_alpha”, bar_mc.bar[“bar” + isel]._alpha, 0, 10);
abs = Math.abs(bar_mc.bar[“bar” + isel]._alpha - 0);
if (abs < 2.000000E-001)
{
bar_mc.bar[“bar” + isel]._visible = false;
} // end if
};
};
changMotion = function ()
{
bar_mc.bar.bar2.homeBtn._visible = true;
var selcount = 0;
this.onEnterFrame = function ()
{
++selcount;
trace (selcount);
sen_story._alpha = sen_story._alpha + -sen_story._alpha * 3.500000E-001;
abs = Math.abs(sen_story._alpha - 0);
if (abs < 10)
{
pro_loader.pro1._alpha = pro_loader.pro1._alpha + -pro_loader.pro1._alpha * 3.500000E-001;
abs2 = Math.abs(pro_loader.pro1._alpha - 0);
if (abs2 < 10)
{
pro_loader.pro2._alpha = pro_loader.pro2._alpha + -pro_loader.pro2._alpha * 3.500000E-001;
abs3 = Math.abs(pro_loader.pro2._alpha - 0);
if (abs3 < 1.000000E-001)
{
pro_loader._visible = false;
sen_story._visible = false;
campaign._visible = false;
changeStateMc(bar_mc, “_x”, bar_mc._x, 50, 15);
changeStateMc(copyright, “_x”, copyright._x, 600, 15);
changColor(2);
bar_mc.defaultSetMenu();
bar_mc.bar.bar1.homeBtn._visible = true;
bar_mc.bar.productLoader.gTimer();
if (selcount > 33)
{
_root.loader_cf.loa.loadMovie(_root.fileURL + “sensual.swf”);
delete this.onEnterFrame;
} // end if
} // end if
} // end if
} // end if
};
};
changbackMotion = function ()
{
bar_mc.bar.bar2.homeBtn._visible = false;
bar_mc.bar.bar1.homeBtn._visible = false;
pro_loader._visible = true;
sen_story._visible = true;
campaign._visible = true;
_root.icon = 2;
this.onEnterFrame = function ()
{
sen_story._alpha = sen_story._alpha + (100 - sen_story._alpha) * 3.500000E-001;
abs = Math.abs(sen_story._alpha - 100);
if (abs < 10)
{
pro_loader.pro1._alpha = pro_loader.pro1._alpha + (100 - pro_loader.pro1._alpha) * 3.500000E-001;
abs2 = Math.abs(pro_loader.pro1._alpha - 100);
if (abs2 < 10)
{
pro_loader.pro2._alpha = pro_loader.pro2._alpha + (100 - pro_loader.pro2._alpha) * 3.500000E-001;
abs3 = Math.abs(pro_loader.pro2._alpha - 100);
if (abs3 < 8.000000E-001)
{
trace (abs3);
mainback();
mainfla.img.play();
bar_mc.bar.productLoader.gTimer();
delete this.onEnterFrame;
} // end if
} // end if
} // end if
};
};
mainback = function ()
{
changeStateMc(imask, “_x”, imask._x, 0, 20);
};
bar_mc.bar.bar1.homeBtn._visible = false;
bar_mc.bar.bar2.homeBtn._visible = false;
bar_mc.logo.onRelease = function ()
{
loader_cf.play();
delete bar_mc.bar.productLoader.list_Num.onEnterFrame;
};
pro_loader.pro1.onRelease = function ()
{
getURL(_root.linkUrl[9][4], _root.linkTarget[9][4]);
};
homeBtn.onRelease = function ()
{
if (con != 1)
{
con = 1;
}
else
{
con = 2;
} // end else if
changColor(con);
};
sen_story.onRelease = sen_story.homeBtn.onReleaseOutside = function ()
{
changMotion();
mainfla.img.stop();
changeStateMc(imask, “_x”, imask._x, -1080, 20);
delete bar_mc.bar.productLoader.list_Num.onEnterFrame;
};
bar_mc.bar.bar2.homeBtn.onRelease = bar_mc.bar.bar2.homeBtn.onReleaseOutside = function ()
{
loader_cf.play();
delete bar_mc.bar.productLoader.list_Num.onEnterFrame;
};
bar_mc.bar.bar1.homeBtn.onRelease = bar_mc.bar.bar1.homeBtn.onReleaseOutside = function ()
{
loader_cf.play();
delete bar_mc.bar.productLoader.list_Num.onEnterFrame;
};