package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var bInstance = new B( );
bInstance.m(); // Displays: Method m( ) was called
bInstance.n(); // Displays: Method n( ) was called
trace(bInstance.v); // Displays: 10
}
}
}
class A {
public var v = 10;
public function m ( ) {
trace("Method m( ) was called");
}
}
class B extends A {
public function n ( ) {
trace("Method n( ) was called");
}
}
Method m( ) was called
Method n( ) was called
10