Slider-spinner control problem


I wrote a simple script to control a foot rig, but there is a tipycal problem with the sliders... It's the next:

I create an event to make changes on the foot. (on Slider changed val do etc.) These happenings are simple step animations. There are 'borders'/'limits', wich help to set unique poses on the bones. When the slider is in the 0.0-0.5 limit, the pose of bones is: blabla, when the slider's value is in the 0.5-0.75 limit the bones are in the blabla position, etc...

It works fine, when I change the value of slider manually! Otherwise, I want to it animate. When I set the slider's value be 0 at the first frame, and be 1.0 at the 50. frame, the event is not works! So the script skip the change of variables, and skip all of the functionst because the event works only when I change manually the slider.

The big question: What can I use to solve this event problem? Wich kind of events run when something changes the value of slider, for example a key animation, or an other spinner-slider etc...?

A part of the script:

on lepes_Sl changed val do
	border = #(0, 0.5, 0.75, 1.0)
	p = 
	local x=1
	while (val > border[x]) do 
		x = x+1
	ca = getCaAttributes_fn()
	if ca.count > 0 do
		for i = 1 to ca.count do
			--print p[x-1][i] + (val - border[x-1]) / (border[x] - border[x-1]) * (p[x][i] - p[x-1][i])
			try(ca[i].value = p[x-1][i] + (val - border[x-1]) / (border[x] - border[x-1]) * (p[x][i] - p[x-1][i]))catch()

Thanks your answers in advance.