What more can be done if I extend MainClass with MovieClip rather than Sprite. I know that MovieClip extends Sprite and it has Timeline defined under it. but still how it will be usable to me by MovieClip ?
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.MovieClip;
import flash.text.TextFieldType;
public class MainClass extends Sprite{
public function MainClass() {
var m:Module=new Module("Admin","John");
var tf:TextField=new TextField();
tf.text=m.info;
tf.border=true;
tf.type=TextFieldType.INPUT;
var myFormat:TextFormat = new TextFormat();
myFormat.size = 3;
tf.defaultTextFormat=myFormat;
addChild(tf);
this.width=500;
this.height=300;
this.x=0;
this.y=10;
}
}
}
class Module{
private var m_mName:String;
private var m_owner:String;
public function Module(mName:String,owner:String):void{
m_mName=mName;
m_owner=owner;
}
public function get info():String{
return owner+' is owner of '+mName;
}
public function get mName():String{
return m_mName;
}
public function get owner():String{
return m_owner;
}
}
Another little question, How to use Timeline if I replace Sprite by MovieClip ?