This was, by far, the most frustrating mini-project that I did. I actually started this about the same time that I did the digital clock and the scrolling text, but I couldn't get it to work right and I didn't know why. Throughout all of my other projects I kept coming back to this thinking that since I had just learned more and more I could suddenly fix it. Nope. Not really. For the longest time it would read that you were touching the border, but wouldn't go to the frame to show that you had touched the border. I had no clue why it wasn't working. It was running the simple code of "gotoAndStop("fail")", but it wasn't doing it. No clue. Then, I saw on another tutorial about the _root. that I add to certain things, so I thought that it would solve my problem! Well, it did. It went to the right fail screen. Alright! Now I go through and get to the end--and it goes to the fail screen. What's wrong? Well, apparently it's reading that you are leaving the line so it's telling you that it did! But, it's rolling over the end so it should run that code, right? I was so confused how to make it work. All through this I was getting increasingly angry at the tutorial I got this from. I understood cognitively what it should be doing, but it just wasn't doing it. In the tutorial his code didn't have the _root.gotoAndStop. They were wrong. (Or so I thought.) I almost didn't even include it in my project, but then suddenly I got it to work!!
It turns out I had converted the line and the end of the line into movie clip symbols instead of button symbols. It said to do that in the tutorial, but I think I figured it didn't matter too much or I didn't notice I wasn't doing it right. I still don't really understand why it doesn't work with the movie clip, but what I do know is that when I used the button symbols, it worked just like it should. And guess what? The tutorial wasn't wrong at all. I didn't need to add the "_root." to the gotoAndStop calls. I was just stupid. You'd think it'd be relieving to finally get it to work, but I just feel even more frustrated becuase it was so simple.
Anyway, this is an actual game you can play! So, have fun with it. I could easily add more levels, but that'll be to add to the future "games" section of my website. :)
Code Used:
There's code spread out throughout various buttons, so just look at the tutorial that I used to help me make it.