I have been working on this… and It is causing all my lag problems… But I kinda just left it until now… Since this is my first flash program… I figure I would wait it out until I got smarter… but a month later I’m still not figureing this one out…
dpd is generally 0 1 2 or so… but sometimes can get in the 20 range… when that happens, lag fest…
while(dpd-- > 0)
{
for(var aa in arrayname)
{
var bb = arrayname[aa].getDepth()-505;
arrayname[aa].swapDepths(bb);
}//depth change loop
}//ends the depth changing if
Basically put, it counts a number… dpd (i think it stands for depth difference) and then it runs the depth changing array how ever many times the depth was changed…
That doesn’t matter much… The problem is, the way it is… It works perfectly. However when I switch it to this… it stops working correctly (works but not correctly… the numbers go wild)
if(dpd > 0)
{
for(var aa in arrayname)
{
var bb = arrayname[aa].getDepth()-(505*dpd);
arrayname[aa].swapDepths(bb);
}//depth change loop
}//ends the depth changing if
In my opinion that whould work…
but it doesn’t I’ve placed trace everywhere, displaying various numbers, and it makes completly no sence what so ever… it’s as if the last one doesn’t remove any depth at all… And dpd isn’t ever 0, which would explain that… help