Hello, I am facing the proble of lagging because of abundant of script.
Could someone kind please help me to shorten this ? Thanks a lot.
Exaple 1:
if(_global.i==5){
_root.shoot5();
}
else if(_global.i==6){
_root.shoot6();
}
else if(_global.i==7){
_root.shoot7();
}
else if(_global.i==8){
_root.shoot8();
}
else if(_global.i==9){
_root.shoot9();
}
else if(_global.i==10){
_root.shoot10();
}
Example2:
if (spy1==1){
with(_root.spider1){
gotoAndPlay(2);
}
}
if (spy1==2){
with(_root.spider2){
gotoAndPlay(2);
}
}
if (spy1==3){
with(_root.spider3){
gotoAndPlay(2);
}
}
if (spy1==4){
with(_root.spider4){
gotoAndPlay(2);
}
}
if (spy1==5){
with(_root.spider5){
gotoAndPlay(2);
}
}