Here is an easy noobie question…
Say I have the following function
function myVideoFunction(event:VideoEvent):void {
do some stuff....
}
but i want to call it from the event listener
button.addEventListener(MouseEvent.CLICK,myVideoFunction);
I cant because it runs off a VideoEvent, not a MouseEvent.
The obvious work around is to copy and paste the function and rename this part, or alternativly just make a function such as:
button.addEventListener(MouseEvent.CLICK,callMyVideoFunction);
function callMyVideoFunction (event:MouseEvent) {
myVideoFunction(null);
}
function myVideoFunction(event:VideoEvent):void {
do some stuff....
}
but what is the proper way to do it? surely that isn’t the correct way?