From pruned CircleCube Video Player to e-Notice module - Movie Gallery Player

蓝慈
2023-12-01


Simple Customerized Event for Video Gallery Function


Since the movie gallery and video player are two separated modules, so I need to develop a manner to communicate them. They are all descendant of the ENotice MovieClip, then I design a custom event and then dispatch it from movie gallery, and capture it at ENotice, and then call Video Player's function from ENotice to play/stop playing videos.


custom event:

// @auther Vincent Zhang
// @dispatch when a video thumbnail in the movie gallery is clicked. 
package com.onsystem.appson.vince {

	import flash.events.Event;
	
	public class VideoThumbClickEvent extends Event {
		
		// event constants
		public static const ON_VID_TMBS_CLICK:String = "onVideoThumbClick";
		
		public var url:String;
		public var aspectOption:uint;
		public var width:uint;
		public var height:uint;
		
		public function VideoThumbClickEvent(u:String, aptOp:uint, w:uint, h:uint, type:String, bubbles:Boolean = true, cancelable:Boolean = false)
		{
			super(type, bubbles,cancelable);
			this.url = u;
			this.aspectOption = aptOp;
			this.width = w;
			this.height = h;
		}
		
		public override function clone():Event
		{
			return new VideoThumbClickEvent(this.url, this.aspectOption, this.width, this.height, type, bubbles, cancelable);
		}
		
		public override function toString():String
		{
			return formatToString("url", "aspectOption", "width", "height", "type", "bubbles", "cancelable");
		}
	}
	
}


code of dispatching it:


function onThumbMouseDown(__e:MouseEvent):void
{
	var __mc:MovieClip = MovieClip(__e.target);
	__mc.playOverlay.visible = false;
	if(_currentPlay != null)
	{
		_currentPlay.playOverlay.visible = true;
	}
	_currentPlay = __mc; 

	var __vtce:VideoThumbClickEvent = new VideoThumbClickEvent(_movList[__mc.no].link, 
											_movList[__mc.no].option, _movList[__mc.no].width, 
											_movList[__mc.no].height, 
											VideoThumbClickEvent.ON_VID_TMBS_CLICK);
	__mc.dispatchEvent(__vtce);										
}

code of capturing it:


import com.onsystem.appson.vince.VideoThumbClickEvent;

this.addEventListener(VideoThumbClickEvent.ON_VID_TMBS_CLICK, playVideoDown);





list some useful links before that:


adobe's online document about meta data of video


http://help.adobe.com/zh_CN/ActionScript/3.0_ProgrammingAS3/WSD30FA424-950E-43ba-96C8-99B926943FE7.html


here is a converter for numeric data, it can convert number among different formats: supports decimal, hexadecimaloctal, binary. 

http://www.tonymarston.net/php-mysql/converter.php


and here is a online color selecter, it is convient to preview a color by typing its RBG value, or vice verse:

http://www.colorpicker.com/

http://www.febooti.com/products/iezoom/online-help/online-color-chart-picker.html













 类似资料:

相关阅读

相关文章

相关问答