That is just a test i had to preform on one of my interviews
below is test description and source files (AS clases etc.) of whole thing you can find here
PART 1
Use the attached flash_test.fla file to create the Main class for this file.
Generate some random shapes at the top of the black rectangle. The shapes can be Rectangles, Ellipses, Triangles. All the shapes will be instances of the following classes: Rectangle, Ellipse, Triangle (these 3 classes will be referred to as “Shapes”). All this classes will subclass the following superclass: GeometricShape.
The GeometricShape class will have the following properties: bodyColor, borderColor, borderSize, speed. All the subclasses will have different information attached that will allow you to compute the surface area. For example, a rectangle will have length and width that will allow to compute a surface area of (width*length). All the “Shapes” will have a method called area():Number that will return the surface area of that specific shape.
All the “Shapes” will be generated randomly with different sizes, different colours, different border sizes and different speeds. A shape will be generated via a method of the Main class: generateShape():Sprite. You will have to generate a shape at a specific time interval that will be chosen from an interval defined by INTERVAL_VALUE defined in milliseconds – you might want to use the setTimeout() method or the Timer class.
PART 2
In the lower part of the screen you will have to display the following information: The number of shapes currently on the screen, the total surface area of all the shapes present on the screen, the total number of shapes generated.
Once a shape is generated, add it on the screen, inside the black rectangle, near the top edge at a random x position. Then the shape should start to move towards the lower part of the screen. The speed of the moving shape is defined in the speed attribute.(If for example the speed is 3, the shape will move with 3 pixels, on each 30 ms – You might want to use the Timer class). Once the shape reaches the black border it will dissapear from the screen, it will be removed from the calculations for the total surface area and from the total number of shapes visible on the screen.
While the ‘Space’ key from the keyboard is pressed, no shape will be generated.