Skip to Content
Beginning ActionScript 2.0
book

Beginning ActionScript 2.0

by Nathan Derksen, Jeff Berg
April 2006
Beginner
835 pages
19h 56m
English
Wrox
Content preview from Beginning ActionScript 2.0

Chapter 12. Debugging Debugged

When you write code, you can expect problems to creep in. No matter how hard you try, there is always something that just doesn't work. Fortunately, strategies exist for reducing, finding, and fixing these bugs. This chapter brings you up to speed on the kinds of bugs you'll be facing.

Types of Bugs

Numerous types of bugs exist that, for the most part, fall into two categories: compile-time bugs and logic bugs. Compile-time bugs are problems that are detected by the compiler and usually involve code syntax or structure errors. Logic bugs involve code that successfully runs, but that does not operate the way that you intend. They are the bugs that you will be mostly concerned with, and that will require the most attention.

Compile-Time Bugs

Compile bugs are the easiest to deal with. As the Flash compiler creates an SWF file, it goes through all of your code and makes sure that it conforms to the required syntax. If any code is invalid, such as an opening brace not having a matching closing brace, or a for statement that does not have the correct usage, it aborts the compile. Additionally, it lets you know where the error is and gives you a description of what is wrong.

The compiler also tests to make sure that all variable, function, and class usage conforms to the rules in their respective definitions. That means that if you declare a variable of type Boolean, and you assign it to a variable of type Number, the compiler will flag the mismatch. You'll also ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Essential ActionScript 2.0

Essential ActionScript 2.0

Colin Moock
ActionScript 2.0 Language Reference for Macromedia® Flash® 8

ActionScript 2.0 Language Reference for Macromedia® Flash® 8

Francis Cheng, Jen deHaan, Robert L. Dixon, Shimul Rahim

Publisher Resources

ISBN: 9780764577680Purchase book