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);
}
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
here is a converter for numeric data, it can convert number among different formats: supports decimal, hexadecimal, octal, 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.febooti.com/products/iezoom/online-help/online-color-chart-picker.html