gavin sim logo
 

Week 1

Week 2

Week 3

Week 4

Week 5

Week 6

Week 7

Week 8

Week 9

Teaching > ActionScript

Booleans

This tutorial aims to look at using booleans in flash.

Quick example

Open flash and create a new document on frame 1 type the following:

var tree:Boolean = false;

if(tree==false){ trace("It is not a tree"); }

Test the Movie. Then alter the value to true and the trace statement will be ignored.

 

Quick example

This example allows you to enter a question into a text box and it will generate a random response of either true or false in response to your question.

 

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

 

Excercise

Excercise see if you can create the application above but instead of having a text box display the answer use a dynamic movie clip and the addChild method. You should have one for false and one foir true.