View Full Version : Pass MouseEvent as Parameter
Niche
10-12-2008, 07:39 AM
I would like to pass a mouse event : MouseEvent.CLICK as a parameter.
example:
activateEvent(MouseEvent.Click,clickedEvent);
function activateEvent(event:MouseEvent,destination):void{
mc.addEventListener(event,destination,false,0,true );
};
wvxvw
10-12-2008, 03:59 PM
The code you posted should work (note it's always better to type your arguments, i.e. destination should be typed to Function). What was the problem with it?
fx.barrett
10-12-2008, 04:09 PM
And your activateEvent function is expecting only 1 argument so this: function activateEvent(event:MouseEvent,destination):void is bad... it should be function activateEvent(event:MouseEvent):void
If you want to pass some additional parameters with your event then you should define your own events because the built in events don't handle such stuff.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.