Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Debugging your app

From: Building Mobile Apps for Multiple Devices with Flash Professional

Video: Debugging your app

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.

Debugging your app

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.

Show transcript

This video is part of

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Building Mobile Apps for Multiple Devices with Flash Professional.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.