davidpadua
12/3/2013 - 12:56 AM

AddListeners Utility Function

AddListeners Utility Function

addListeners() utility function

private function addListeners(objects:Array, type:String, func:Function):void {
	    var i:int = objects.length;
	    while (i--) {
	        objects[i].addEventListener(type, func);
	    }
	}
	 
private function activateUI():void {
	     
	    addListeners([controlUI_mc, videoContainer_mc, playPauseBigButton_mc], MouseEvent.ROLL_OVER, toggleControlUI);
	    addListeners([controlUI_mc, videoContainer_mc, playPauseBigButton_mc], MouseEvent.ROLL_OUT, toggleControlUI);
	    addListeners([controlUI_mc.playPauseButton_mc, playPauseBigButton_mc, videoContainer_mc], MouseEvent.CLICK, togglePlayPause);
	     
	}