There MUST be a better way than all this looping!

Hello everyone - i am trying to build something using mostly code but i am having a SERIOUS issue with the fact that i can only get it to work properly if i have it spanning 2 frames with my code on the first, and code on frame 2 simply “gotoAndPlay(1);” to loop it so my script keeps being rechecked for changes in variables. Because i have things trigger when variables change…heres what i mean.


if(_global.logged=="true"&&faded==false){
new Tween(usr_matt, "_alpha", Strong.easeOut, 100, 0, 2, true);
faded==true;
}

which should trigger when a loaded swf sets the global logged variable to true. But unless i loop the timeline to keep checking the variables nothing happens because it doesnt know its changed, it doesnt watch/listen to it. the problem with this in this case is everytime the timeline loops it reinitilizes that if statement and starts the tween all over again, meaning it never fades because it keeps restarting the fade!

another example being -


if (usr_name.text=="Matt"&&usr_pass.text=="test"){
submit.enabled=true
}else{
submit.enabled=false
}

here i disable the submit button until the fields match, so again i needed to loop the timeline to keep the variables updating to see when the fields did match! unfortunatly that messed up the next bit of code so i had to impliment a work around for it


if(init<=1){
usr_name.text = des_usr;
init=3
}

where i have a text field that inherits its .text value initially from a global variable, but then in order (just in case) the user wants to change the value (if they dont like the default) i needed to break to loop by making a whole new variable to cancel it out once its been triggered once!

My head is just starting to hurt with ALL the variables im assinging and i havnt really even dont anything yet but make a popup box and pass some variables…but christ…i cant have every timeline on a loop that would bog everything down SO much, eventually i will have 4-5 loaded swf’s on at once, all looping? i dont think so…

There HAS to be a better way to do it, to assing certain If statements to constatly update without looping the whole ■■■■ thing!

–][–