Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Essential to any project is testing it out and troubleshooting any issues. Flash does a great job with this because I contest this Flash file in Flash or I could even debug it directly on the device. So it's really cool. First I am just going to start out on my desktop, again, with this app what I want to do is I want to be able to get the answers of the cards to figure out which ones match up to help me test the correct answers. So I am going to open up this document Class by editing the Class Definition, I am going to hit F4 and I can see all my code in here.
So this is where we have variables, where we resize things and really where the cards are created is where I want to scroll to. So here we are createCards. This is the where the cards are created and there given matching numbers. There is it's going to be duplicate numbers, so there is going to be two 2s, two 1s and two 3s basically. So I want to trace out the numbers and figure out where they are at on the stage. So I am going to type in trace, I am going to figure out the "Correct Seq:", is what I am doing.
So essential to testing is getting this sort of information just to help you figure out how you can troubleshooting the issues. Again, I am going to get this card array is what I am going to get so I will just copy that, paste that right in here. Those are going to be my correct answers, because they get stored in that array and it will give me a string of six numbers and they match up basically three pairs. So with that in place, I will just save this file. So I will test this out on my desktop.
So AIR Debug Launcher, I am going to select Test and it opens up my output window, gives me that tray statement Welcome! And it doesn't matter which category I pick. It will give me the correct sequence. I am going to stick with Easy. As I select that, it says the Correct Seq: 2,3,3,2,1,1. Okay, and this says the NUMBER _OF_CARDS: 6. So this is really good. I can go ahead and pick out those two 3, which are right here. one 3, two 3, perfect, and next step we have this 2 and that 2, so this one here and this one, pick those out and then these ones right there, just like that, so I can test out how everything works on my desktop.
Looks good, I like how it works. But I need to take this to the next level and actually test it out on my device. With my Android device connected, again, I have it allowing for the installation of nonmarket apps, but I have it connected by USB. Now keep in mind that I have this Correct Seq: set up which is right here. That looks good, and I can not only add trace statements, but I can also add breakpoints. So say for instance, before you create the board, maybe I want to add a breakpoint right there.
So we will actually stop at that point, give me a chance to read the Correct Sequence, and then I'm able to continue on through the ActionScript to have it execute. But this is the exciting parts going to Debug > Debug Movie and here we'll go ahead and test it out on the Device by USB. Again it's connected, I will select it and it will publish it out and launch it on my device. Here it is on my device. You can see everything is looking good.
Now I am going to go ahead and select the Easy button and if I take a look at Flash, you'll see that it will actually print out the Correct Sequence. So it's getting that information from the app that's running on my device. So I will select Easy, and you can see right here in Flash, it actually changes the interface to the Debug version. As I scroll down you can see it gives me that Correct Sequence. In fact, where I added that breakpoint, it actually stops the code at that point in time.
So it stops it right there before it creates the board. I can see right down here the Correct Sequences is going to be 3,2,2,3,1,1 and I can go ahead and use that to check out the code on my app. So nonetheless, I'm going to go ahead and go to Debug and I am going to select Continue and it will continue on from that breakpoint and run the rest of this app. So Continue, if you can see it on my device, it continues to that screen and I can start playing the game in troubleshooting any issues.
But it's great that my device and in particular my app is talking to Flash. It really helps me troubleshoot any issues that might come up or just helps me test any scenario I might be thinking of. Now that I've debugged this app, all I need to do is, go to Debug and I can Remove the Breakpoints in this file. It removes all the breakpoints, and lastly, I can always end the Debug session, once you're done troubleshooting your app. There it takes me back to my original workspace and I can continue on, working on this file, taking care of any issues that I want to directly on the device by debugging directly on the device.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98223 Viewers
61 Video lessons · 85535 Viewers
71 Video lessons · 69488 Viewers
56 Video lessons · 101826 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.