Main Content

You are here:

Traces and Comments

Hello and welcome. Today we shall be learning about two concepts of Flash, traces and comments. We shall start with traces. Traces are a simple way of the code telling the developers things - the end user can't see them.

Traces are used for debugging - checking what variable values are, whether Flash runs this bit of code, that sort of thing. Traces are the simplest of all things. Traces are the most useful of all things. You will notice, somewhere in you copy of Flash, there will be an output window. If you can't see it, it will probably appear when you send your first trace. The trace function goes like this:

trace("my message");

Simple! Though comments are a little harder. Comments are bits of information that don't get looked at by Flash, but can give useful insights to others or yourself later, explaining what code does. // denotes a single line comment, whereas /* */ denotes a multiple line comments. Below are some examples.

//The compiler doesn't read this;
It reads this bit;//but not this bit;
/*It doesn't
read any of
this */

You see? Easy. In longer projects, it is especially necessary to add in comments.

See you next time!

Harry.

Comments