Document class vs manual instance of the same class

Same class gives me different results when called from Properties panel(declared Document Class) than called manually.

I mean a have a class called Login and when I make an instance of this class

var log:Login = new Login();

doesn’t give me the wanted results…

  • When it is declared Document class it adds a child on stage
  • When the same class is called manually (via the above code) although I get no errors nothing is added on stage.
    Any clue?