nth1971
asked on
eventListner parameters and functions
Hi can anyone advise why my parameters are not being passed into the function
hoverGrow.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(315000, 350));
hoverGrow1.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(280000, 350));
hoverGrow2.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(315000, 1150));
hoverGrow3.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(200000, 1150));
hoverGrow4.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(315000, 28000));
hoverGrow5.addEventListener(MouseEvent.MOUSE_UP, DeltaShareExp(595000, 28000));
function DeltaShareExp(event:Event, startingNumber:Number, endingNumber:Number):void
{
var i:uint = 1;
var myTimer:Timer = new Timer(10,100);
myTimer.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void
{
var xNum:Number = startingNumber - i++ * endingNumber
myText.text = String(xNum);
});
myTimer.start();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DISCLAIMER: you're not meant to copy and pasted my code verbatim as I typed it directly into the EE editor and haven't done any testing. There are certainly typos. Sorry about that.
ASKER
Tom, Interesting particularly the way you have approached it... take a while to absorb this but I get the gyst and I understand what you say in the first comment so thanks that really helps.... and thanks dgofman works perfectly.
ASKER
Open in new window