This is the strangest thing that I have ever seen. Has this happened to anyone else? I'm trying to make a player AI, and I ran into a problem that the script would only run on certain frames. //Other code above } if(right==1||left==1){ //Other Code Below For some reason, Flash refused to go into this if statement. Then I changed it to this for testing purposes: //Other code above } trace("R"+right+"L"+left); if(right==1||left==1){ //Other Code Below After this, it began to work, and when I removed the line it stopped working. Does anyone know why?
I'd have to see the rest of the code to know what's going on. Honestly, I can't see what's going wrong.
Is this script in the main timeline? If so, is the script present on the same frame as where you are having the trouble? Usually the biggest cause of this kind of problem is that you are trying to access a variable from a different frame in the timeline, or possibly a variable that is in the timeline of one of your MC's. The easiest fix, if this is the case, is to declare your variables as _root like (_root.myMovieClip) or (_root.variableName) If your variable is nested inside a MC timeline you have to call into the MC (_root.myMovieClip.variableName) If your still having trouble let us know... Hope this helps...