Dropping the spheres

The player will be able to drop the spheres by clicking with the mouse on the column he/she wants to drop a sphere. Once a sphere has been dropped, it will fall down until it touches the floor of the balance or another sphere.

We need another class level variable to store the position of the row where the sphere will drop, just like we are storing the position of the column with selCol. Add the new variable, called selRow.

private var balance:balance_mc=new balance_mc();
private var gameArray:Array;
private var ball:ball_mc;
private var selCol:int;
private var selRow:int;
private var gameStatus:String="placing";

Do you see something strange in these variable declarations? selCol and selRow have been defined as integers, but ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.