Posts Tagged ‘trigger event’

h1

Trigger Events : Flash Action Script

June 19, 2014

we can trigger any of the object’s event in another object event

Coding :

btnAnother.addEventListener(MouseEvent.CLICK, btnAnotherClick);
function btnAnotherClick(event:MouseEvent) 
{
	/// your code
}

btnOne.addEventListener(MouseEvent.CLICK, btnOneClick);
function btnOneClick(event:MouseEvent) 
{
   btnAnother.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
   /// Can trigger any event like MOUSE_OVER,MOUSE_OUT.... 
}

Advertisements