好菜坞原则与AS2

      AS3 2004-10-12 11:34:00
好莱坞原则:
  留下你的电话号码,我会与您联系!
可以在Main类中增加一下方法
class Main{
private static var callback:Object;
public static function register(obj:Object):Void{
callback=obj;
callback.hello();
}
}
然后在Sub类中进行注册
class Sub{
function Sub(){
Main.register(this);
}
public function hello():Void{
trace("hello!);
}
}
标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}