We all know the Dummies and the Idiots series. Of course, there is an "ActionScript for Dummies" book. And an "ActionScript for Idiots". Don't be fooled. These books are way over your head. On these pages you will find the only help availabe for deep morons.

Well – not quite that much fun. Let’s keep things in perspective, here.

But look. You’re going to be working in the Actions Panel a lot. And if you’re anything like me (a lazy moron) you’ll do this tons of times without ever bothering to look up just what all functions this Panel has. It’s too tedious, too much work.

But this is no walk in the park. We’re at Moron Boot Camp, here. So prick up those lazy ears of yours, and take note. It will make your life easier, in the end. Not that that’s my motivation. My motivation is, of course, to make you miss out on all the fun other people are having right now, at the beach, in bars, at delightful pool parties. Are you picturing it? How happy they are…Not, however, you. You have work to do.

Well then. Let’s start with a picture! A picture speaks, after all, a thousand words.

It does speak words! In fact, it is asking you a question. And I bet you don’t know how to open the secret little window on the left – unless, of course, it is already open. But in that case I bet you don’t know how to close it. I’ll show you. Cause that’s the kind of person I am.

See? The Secret Panel! you click on the tiny arrow, and suddenly a new world opens up. Now you get the picture below.

Actions Panel with ToolboxThere we are.

This extra panel is called the Toolbox. What are you going to do with it? Well, for the moment not too much, I suggest. You can look through it to find some method or other stuff you’ve forgotten the name of. But since, at the moment, you hardly know any ActionScript at all, there really isn’t that much that you can have forgotten. So you may as well click the Toolbox away, and retain more space for writing code.

Still – if you insist on using it, you do so by clicking on the little Plus sign at the top of your Actions Panel.

Supposing, for instance, that you need a random number. But by Golly, you just can’t remember how to write it! And because your parents/spouse/children have taken your internet privileges away after you spent your nights at Facebook or Bianca’s Smut House, you can’t go online to find it.

So click on the little Plus. Now you have a tough choice to make: which group of elements should you expand? In this case, it’s Top Level. (But you didn’t know that of course, and would likely have to go on the internet to find out.) Within Top Level, you see Math. That should bring you closer! And it does.

Here’s the mess you get when you go clicking on the necessary submenus of the Plus sign, just to get to random numbers:

Expanded Toolbox Items

Actually, you can also go directly into the toolbox, click on Top Level and then the other submenus you need, until you get to the word “random”, and then double click on that. With a wooshh! sound, Flash puts the random number function right in your actions panel! You didn’t have to type a word, yourself!

Toolbox items

You can use it for just about anything ActionScript has to offer. Even for, for instance, operators. (Don’t know what they are? See Nugget Operators!) Datatypes, anything!

But there’s an easier way to find something you need – especially if you know how the word or the words start. That’s to use so-called Code Hints, and boy, do you really need to use those! Don’t let me ever catch you not using them.

We’ll look at them in the next installment of this breathtaking series.

Let me know what you think!

Stacking Order

March 26, 2012

In Nugget “This, Child and Parent” we had a look at the hierarchy that exists between parents and children. The parent is above the child. That is how it should be in the entire world. But how are things between the children of one parent? What about the sibling rivalry? If a parent has 5 [...]

Read the full article →

For… loop in a for… loop

April 24, 2011

Let’s say you want to place 36 balls on the stage, in 6 rows of 6 balls. They will be 50 pixels apart from one another, both horizontally and vertically. Of course it’s possible to code: var ball1:MovieClip = new Ball(); ball.x = 0; ball.y = 0; and then for the second ball: var ball2:MovieClip [...]

Read the full article →

Following the mouse at a distance

April 19, 2011

What if you want to have the object follow the mouse at a little distance? Well, let me say beforehand that you can’t make the distance between mouse and object too large. We’ll see why a little later. But you can use a short distance, which will make the impression of being followed in an [...]

Read the full article →

Geometry Class I: Distance between two points

April 8, 2011

Geometry is frightening, and when it has the word “class” behind it, doubly so. But in this first Geometry nugget we’ll ease into things, and find that this class can be quite useful. If you’ve bravely battled through nugget Distance between two points, you’ll know all the geometry for our present task. Supposing I have [...]

Read the full article →

HitTest: hitTestPoint

April 1, 2011

With hitTestObject() (see here) we checked one object against another, to see whether they touched. So for instance, if I have objects blob and star, and I use if (blob.hitTestObject(star)){ do something } I get a hit whenever the bounding boxes of my objects intersect. I’ve drawn the bounding boxes and the registration points of [...]

Read the full article →

HitTest: hitTestObject

March 28, 2011

There’s a lot of circumstances in which you may want to know whether two things have touched each other – whether “unhealthy friendships” are developing, in the words of old British boarding schools. Two methods deal with that: hitTestObject and hitTestPoint. The first one compares, you guessed it, two or more objects to see if they [...]

Read the full article →

Following the mouse

March 28, 2011

In nugget Dragging a movieclip by not dragging it we saw how you can drag an object by making it “stick” to the mouse.  But things were deceptively simple, in that tutorial; the object that clung to our mouse was a circle. And you can’t see which way a circle is turned. So you never had [...]

Read the full article →

Exercise: Circular Movement

March 26, 2011

Create a sun and 4 planets. The planets vary in size, whereby planet1 is the largest, and Planet4 is the smallest. Make it so that all planets orbit the sun, except forPplanet4, which orbits planet1. The orbits vary in speed, as well as in radius; some orbits are large, others are small, some are fast, [...]

Read the full article →

Exercise Circular Movement: answer

March 26, 2011

If your movie works much like the one you saw in the exercise, you’ve done fine. Your solution may vary from mine, which means it may be worse, or it may be better. This is the code I ran: var sun:Sun = new Sun(); sun.x = stage.stageWidth/2; sun.y = stage.stageHeight/2; addChild(sun); var planet1:Planet1 = new [...]

Read the full article →
//deze heb ik nog niet nodig: [your name] on Facebook Subscribe to The Moron's Guide to ActionScript by Email