So this is a weird error that I am getting because I have four movie clips on my frame that I have running back and forth across the screen in a frogger like game. Three of them work and the fourth one does not even though I have the same code basically for all of them. Why would I get an error for one, but not the other 3? Here is my code:
Seth is the one that doesn't work, but basically this makes these movie clips of running characters look like they are running back and forth and the lanes is the speed at which they go and the turns are just to make sure that they go all the way to the side.
That is my first question.
My second question is I have a character on the same frame and I want to move him via the keyboard and I am using senocular's keyObject class and it doesn't work unless if I minimize the screen and then re-open the screen. Once I re-open the screen it works just fine.
I have a hunch that both of these problems are related to a movie clip not being fully loaded, but I am new to flash and as3 so any help would be greatly appreciated. Also if more clarification is needed please ask for it so I can get some help cause I have had this problem for about 2 days now and still can't figure it out!
should work :s make sure all variables are set properly and re write the whole of the seth part, you might come across an error thats hidden away :P copy mel part and then paste it in and replace mel with seth and change the numbers etc.. also make sure the MC is given the correct instance name
haha thanks, I guess I will try rewriting the seth part. However what could cause my second question? I have to minimize the screen before my main character moves with the keyboard, but only when I minimize it and it is not I have to wait 10 seconds I can do it right away or wait 30 seconds and then my main character will move.
Also I tried re-writing the seth part, but got the same error which I forgot to mention is: #1009 cannot access a property or method of null object reference.
My error message is right above your post and I am loading them in from the library, I know it should be from a class, but I am just trying to get something the works currently.
Give the instance of 'seth_run' on frame 2 an instance name, example 'demo_seth'.
In frame 2, added line 'play_button.mouseChildren=false;' below line 'play_button.setLabel("Play");' (I don't have the code for setLabel, so I commented out that line.)
Added import statement on frame 3, 'import com.senocular.utils.KeyObject;'
Give the instance of 'seth_run' on frame 2 an instance name, example 'demo_seth'.
In frame 2, added line 'play_button.mouseChildren=false;' below line 'play_button.setLabel("Play");' (I don't have the code for setLabel, so I commented out that line.)
Added import statement on frame 3, 'import com.senocular.utils.KeyObject;'
Thanks a lot dawsonk, yeah that did it for some reason. I did the same thing with kate that I had done with seth so I am not really sure what was going on, but I still don't have an answer for the second question.
well alrighty... then I am not sure what is going on because I am still getting the same error with the keyboard movements. I am not sure why, but I guess I will troubleshoot it. Maybe it has to do with the Dynamic Button class from the previous scene?
I have now moved away from using a class and just using a simple button, now correct me if I am wrong, but the below code should work, well actually it does, but I still get the error I was getting with the class.
Here is the code I am using:
PHP Code:
stop();
playGame.addEventListener(MouseEvent.CLICK, buttonClicked);
var clicked:Boolean = false;
function buttonClicked(event:MouseEvent){
clicked = true;
this.gotoAndStop('start');
}