For this lab, I opened up my lab 26 flash file and I saved it as lab 27 in my lab 27 folder. Then I created 2 new scenes by going to insert-scene. In the second scene I used the rectangle tool with a red fill color to make a red background then I used the text tool to write oopps you lose. Then I created a button that says try again and I changed it's color in the hover and down area. I renamed the layer that had the background and button as contents. Then I clicked on the button and went to the properties panel and gave it an instance name. In the third scene I repeated the steps except that I used a green fill color and I put the text congrats you win and the button that I made said start over again. Then I selected the button and went to my actions panel and I clicked on code snippets-timeline navigation-click to go to scene and play. I changed the scene to scene 1 so it would go back to that scene when I clicked on the button. I copied and pasted the code into my scene 2 actions panel and I changed the objects name and the functions name.
Then I went to my scene one and I put an obstacle and a x mark to show where the cat needs to go to and what to avoid so you won't lose. Then I selected the cat and I inserted a new code into my actions panel that tells ActionScript that if the cat goes into this area to play the scene where it says you win, and if the cat goes onto this certain area then to play the scene where it says you lose. This lab was a bit hard because I first had trouble with my code because it kept on blinking but then I read what was wrong in the compilers errors panel and I tried to fix it according to that and also I had reference to the code provided to me so I was able to fix the errors and make it work with both using the keyboard and the arrows. I really liked how it came out in the end and I am really happy with getting it work since I am still getting used to AS.
Then I went to my scene one and I put an obstacle and a x mark to show where the cat needs to go to and what to avoid so you won't lose. Then I selected the cat and I inserted a new code into my actions panel that tells ActionScript that if the cat goes into this area to play the scene where it says you win, and if the cat goes onto this certain area then to play the scene where it says you lose. This lab was a bit hard because I first had trouble with my code because it kept on blinking but then I read what was wrong in the compilers errors panel and I tried to fix it according to that and also I had reference to the code provided to me so I was able to fix the errors and make it work with both using the keyboard and the arrows. I really liked how it came out in the end and I am really happy with getting it work since I am still getting used to AS.
No comments:
Post a Comment