⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eventobserver.as

📁 Yahoo!search API. 用于搜索引擎接口
💻 AS
字号:
import com.yahoo.event.Event;
import com.yahoo.core.CoreObject;
import com.yahoo.util.ObjectUtil;

/**
 * 
 * @see     CoreObject	
 */
class com.yahoo.event.EventObserver extends CoreObject{
	private var $listeningInstance:Object;
	private var $methodID:String;
	private var $messageName:String;

	/**
	 * 
	 * @param   listeningInstance 
	 * @param   messageName       
	 */
	public function EventObserver(listeningInstance:Object, messageName:String){
		super();
		this.setClassDescription('com.yahoo.event.EventObserver');
		if(ObjectUtil.isTypeOf(listeningInstance, 'object') || ObjectUtil.isTypeOf(listeningInstance, 'movieclip')){
			this.setListeningInstance(listeningInstance);	
		}
		if(ObjectUtil.isTypeOf(messageName, 'string')){
			this.setMessageName(messageName);
		}
	}

	/**
	 * 
	 * @param   listeningInstance 
	 */
	public function setListeningInstance(listeningInstance:Object):Void{
		this.$listeningInstance = listeningInstance;
		// trace('[EventObserver] listeningInstance: '+listeningInstance)
	}

	/**
	 * 
	 * @param   methodName 
	 * @param   e          
	 */
	public function callMethod(methodName:String, e:com.yahoo.event.Event):Void{
		this.$listeningInstance[methodName].apply(this.$listeningInstance, [e]);
	}

	public function getListeningInstance():Object{
		return this.$listeningInstance;
	}

	/**
	 * 
	 * @param   messageName 
	 */
	public function setMessageName(messageName:String):Void{
		this.$messageName = messageName;
	}

	public function getMessageName():String{
		return this.$messageName;
	}

	/**
	 * 
	 * @param   eventObj 
	 */
	public function handleEvent(eventObj:com.yahoo.event.Event):Void{
		// trace('[EventObserver: handleEvent invoked]')
		this.$listeningInstance.handleEvent(eventObj);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -