clipeventsupport.as

来自「jquery插件」· AS 代码 · 共 3 行

AS
3
字号
/*    
 *    Copyright (c) 2008, 2009 Flowplayer Oy
 *
 *    This file is part of Flowplayer.
 *
 *    Flowplayer is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    Flowplayer is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.flowplayer.model {
	import org.flowplayer.flow_internal;		use namespace flow_internal;
	/**
	 * @author api
	 */
	public class ClipEventSupport extends ClipEventDispatcher {
		private var _clips:Array;
		private var _commonClip:Clip;

		public function ClipEventSupport(commonClip:Clip, clips:Array = null) {
			_commonClip = commonClip;
			_clips = clips;
		}
		
		flow_internal function setClips(clips:Array):void {
			_clips = clips;
		}
		
		public final function get clips():Array {
			return _clips;
		}
		
		public static function typeFilter(type:ClipType):Function {
			return function(clip:Clip):Boolean { return clip.type == type; };
		}

		override flow_internal function setListener(event:EventType, listener:Function, clipFilter:Function = null, beforePhase:Boolean = false, addToFront:Boolean = false):void {
			var eventType:ClipEventType = event as ClipEventType;
			if (eventType.playlistIsEventTarget) {
				super.setListener(eventType, listener, clipFilter, beforePhase, addToFront);
			} else {
				_commonClip.setListener(eventType, listener, clipFilter, beforePhase, addToFront);
			}
		}

		override internal function removeListener(event:EventType, listener:Function, beforePhase:Boolean = false):void {
			var eventType:ClipEventType = event as ClipEventType;
			if (eventType.playlistIsEventTarget) {
				super.removeListener(event, listener, beforePhase);
			} else {
				_commonClip.removeListener(event, listener, beforePhase);
			}
		}
	}
}

⌨️ 快捷键说明

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