02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoPrevious Video

Single Line Comment

We already discussed comments during the very first video of this course. There the discussion was brief, but here you can find detailed information about mainly the single line comment.

When we want the compiler to ignore a line or number of lines in the program, we use the concept of the comment. By mentioning "single line comment," we mean that the code to be ignored (or a comment added to it) is single line and not multiple. However, single line commenting can be performed multiple times to make sure multiple lines are omitted by the compiler.

Syntax for single line comment

There isn't anything difficult to remember when it comes to the syntax of the single line comment. We just need to type // before any line or part of the line for the program to ignore it. The line is still in the program, but is not read by the compiler during the process of compilation. The general syntax is //trace("Yo mama wears army boots!");. For example, let us consider //trace("this line is commented out"); As soon as we placed // before trace, the whole line is neglected by the compiler and the text inside the double quotes is not printed.

Why does the single line comment even exist?

Many of you might wonder why we need to learn the theory of commenting, when its use is limited to commenting out a certain line when it's certainly much more simple to just delete it. Don't forget that deleting means that line is gone forever – play Taps for it. What if you need it later – especially if you're using it for testing purposes? You get to retype it, that's what. Now, if only you'd commented it out.... remove the // and you're back in business! That line is again part of your program. When commenting, nothing is deleted but the commented line is just ignored by the compiler and can be reused (or not) anytime you want!

Equally useful to having the compiler ignore a line, single line comments can also be used to describe the usage of a particular line within the program. Developers can write comments beside the actual code, such as:

trace("I am inside the newName function"); // this outputs only when the newName function is called

This is useful for developers maintaining or updating your code and learners because they can read the comments beside the line to understand its usage and why that line was included in the code.

Intro

In this video, we will learn the basics concepts of coding in Flash. The main focus is on the output panel. Once we understand Flash's environment, then we learn how to manage the output panel.

03:16

Publish Settings Recap

Get into a rhythm of efficiently setting up your files so you can smoothly transition into writing code. This video shows you how to compile your .swf and .html files..

03:41

Setting Up Our Main Class

Get into a rhythm of efficiently setting up your files so you can smoothly transition into writing code. This video shows you how to set up your script for all the code you'll write from here on out.

04:51

Test Movie

The basics of working with Flash, focusing on the publish settings and testing movies.The basics of working with Flash, focusing on the publish settings and testing movies.

00:58

Trace

For your first programming task, you'll experiment with the 'trace' function and learn how to output data from your application. This can be used to print the desired text at will.

04:08

Single Line Comment

In this video we will learn the syntax of single line comment and the need for its existence in programming, and explore how to create them in actionscript 3 flash.

01:25

Numbers And Basic Math

In order to do great things in flash, all you need is a grasp of basic math. So let's work on computing mathematical equations using the 'trace' function.

06:42

Answer To Math Question

In order to do great things in flash, all you need is a grasp of basic math. So let's work on using the Trace function to compute mathematic equations. We ended the last video with a question, let's s

01:40

Multi line Comments

You already know how to comment line by line but wouldn't it be nicer for you and your fingers if you could cancel out a full block of code? Yes, it is possible using multi line comments.

01:40

What Are Variables?

Learn how to create different kinds of variables and see how they can make your life easier as your code gets more complex. They play a major role in writing the code efficiently.

02:20

Strings As Our First Variable

learn how to create your first string variable in actionscript flash. This video helps you understand how to declare a variable and assign a string to it.

03:42

Error 1067: Implicit Coercion

Help-I just got the dreaded 1067 error... ohh actually it is not that bad it is telling me something... but what? Let’s learn about 1067 error and know how it is helpful to the user

01:21

Numbers As Our Second Variable

Learn how to create different kinds of number variables and see how they can make your life easier as your code gets more complex. Also learn the syntax for declaring all types of numbers

01:56