Tiled background in AS3, help to modify a function

Hello you all.
Ok i’m new here and really new to AS3, i was beginning to understand AS2 (lol) and now I have to compile this working AS2 function to AS3, can you help me and comment it so that I can understand. Many many thanks.
(ps. can you maybe give me the url of a website where I can look for simple commented AS3 to learn again cause I’m lost with all these removed and new functions)

Thhis script is to tile a file loaded in the Library and called ‘pattern’ all over the stage.

 [FONT=&quot]import flash.display.BitmapData;[/FONT]
  [FONT=&quot]var tile:BitmapData = BitmapData.loadBitmap("pattern");[/FONT]
  [FONT=&quot]this.lineTo(Stage.width, 0);[/FONT]
  [FONT=&quot]this.lineTo(Stage.width, Stage.height);[/FONT]
  [FONT=&quot]this.lineTo(0, Stage.height);[/FONT]
  [FONT=&quot]this.lineTo(0, 0);[/FONT]