View Full Version : Passing parameters in event callback function

08-10-2006, 08:55 AM
Does anyone know how you can pass extra parameters to an addEventListener callback function? Currently, my callback accepts the parameter event:EffectEvent, but also would like to pass in an integer.

I've tried the following, but I get an error (1120: Access of undefined property event), I appreciate this is because it doesn't know what event is, but how else do I pass it?

tween_objects[i].addEventListener( EffectEvent.EFFECT_END, effectEnd( event, i ) );
tween_objects[i].target = shapeCanvas_object[i];
tween_objects[i].duration = 1000;
tween_objects[i].heightTo = s;

private function segEffectEnd(event:EffectEvent,index:int):void
shape_object[index].width = shapeCanvas_object[index].width;
shape_object[index].height = shapeCanvas_object[index].height;


Bit lost I'm affraid. Any ideas?

08-10-2006, 09:51 AM
hmmm only 3 posts away


08-10-2006, 09:52 AM
Bugger! I'm clearly not paying attention this morning... Good jobs there's no meetings! :D