GenericButton video tutorial

[flashvideo filename=”http://www.gfxcomplex.com/video/main.flv” /]

heres the class you will need to make this work.

package com.gfxcomplex.button{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	public class GenericButton extends MovieClip{
		private var hitTest:Boolean = false;

		public function GenericButton(){
			initListener();
			stop();
		}
		private function initListener():void{
			this.addEventListener(Event.ENTER_FRAME,		onEnterFrame);
			this.addEventListener(MouseEvent.MOUSE_OVER, 	onMouseOver);
			this.addEventListener(MouseEvent.MOUSE_OUT, 	onMouseOut);

		}
		private function onEnterFrame(e:Event):void{
			if(hitTest){
					nextFrame();
			}else{
					prevFrame();
			}
		}
		private function onMouseOver(e:MouseEvent):void{
			hitTest = true;
		}
		private function onMouseOut(e:MouseEvent):void{
			hitTest = false;
		}

	}
}

0 Responses to “GenericButton video tutorial”


  1. No Comments

Leave a Reply