flexy
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;
tween_objects[i].play();
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?
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;
tween_objects[i].play();
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?