|
Post by P.Q. on Jan 14, 2012 21:55:17 GMT -7
This tutorial is how to go to the next frame when the car touches movie clip as for a racing game,such as the crossing line the car needs to get to will be the movie clip! The car will also be a movie clip.
" well you need to first give the car an instance name and your target movie clip another name don't make it a button so on the main timeline in the first frame ( or the same timeline as your game or whatever ) but this: this.onEnterFrame=function() { } this tells flash to do this every frame
if (NAMEOFYOURCAR.hitTest(NAMEOFYOURCLIP)){ nextFrame(); } in the parenthesis thing
this.onEnterFrame=function() { } this.onEnterFrame=function() { if (NAMEOFYOURCAR.hitTest(NAMEOFYOURCLIP)){ nextFrame(); } } yeah that would be the whole code"
Thank's to my friend <3
Ok and here what I did wrong
I needed to put this code instead because I had stop(); below the OnEnterFrame Function and stupidly enough flash is censored by capital letters so If you put caps in what your instance name stop(); this.onEnterFrame=function() { if (car.hitTest(runway)){ gotoAndStop(3); } } and rename your car car instead of Car with a capital C
|
|