I know what I want to do... Just how do I do it?

I want to do something really simple in flash in AS3 but I must be typing the wrong words into Google.

Basically I want to do this:
Frame 1 -
Create a shape and define its size by using a fixed height and a random number for the width

Frame 2 -
Resize the shape width either smaller or larger by 1 pixel.

Then repeat frame 2 until the shape reaches a defined limit and then it reverses.

If anyone can point me in the direction of some good tutorials, that would be much appreciated.

Regards.