The AS compiler will automatically reorganize your code. In reality, it will appear more like this:
public var name:String;
public function Greeter(initialName:String = "") {
name = initialName;
}
You can test this by doing the following:
public var name:String = "Hello!";
public function Greeter(initialName:String = "") {
trace(name); // outputs Hello!
}
This too, will work:
public function Greeter(initialName:String = "") {
trace(name); // outputs Hello!
}
public var name:String = "Hello!";
All code that resides in the class, but outside of a method (including the constructor, which is simply a special method) will be executed prior to constructor code, which can be a little misleading.
In general though, don't do anything outside of methods except at most setting variables like above. Normally all setting up should be done within the constructor.
EDIT
I'm updating my answer so the OP get's the correct information even though another answer has been accepted.
The compiler does recompile code. See below images - I am using the SoThink SWF decompiler which shows the state of the class file after the SWF has been published. Notice how the line is brought up, and so it is actually reorganised so it exists at the top of the class.
The Flash Document calling the class

The class code (note the variable at the bottom)

The decompiled SWF class code (note the variable at the top) Out of interest, also note how Flash internally changes variable names, such as param1, etc

If you have sothink decompiler you can try this for yourself.