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


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













评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值