I have been on this for better part of today and was unsuccessful
I'm trying to do custom slider similar to example for Animation Engine plugin ( yes I'm using AE )
But in the example is used constrainRectangular to constrain movement of slider into the slider background.
In my case the background is smaller than the slider and if I use the same constrainRectangular it will move the slider slightly higher than the background so it looks like ( see attachement ) which is not desirable :-/
So I changed it to constrainLinear and will get the position of background do some math to get first point and second point and set it to it..
I have put the code in button so I can test it, it looks like this:
Code: Select all
on mouseUp
put first item of loc of image "pPozadie" into x --pPozadie is backboard
put second item of loc of image "pPozadie" into y
put x-22 into x1 --get the start point of line I want to move it on
put x+22 into x2 -- get the last point of line
put y+7 into y -- move it little bit down so it is centered ( the nob )
set the constrainLinear of image "posuvak" to x1,y,x2,y --posuvak is the shuffle nob
end mouseUp
PROBLEM:
The whole stack is resizable, and the background can move so I need to automatically set the nob to correct path, so I was thinking
that I put the same code that is in button to resizeControl so it will update the coordinates every time app is resized.
Code: Select all
on resizeControl
doFitImg -- here it calls the same code that is in button above ..
pass resizeControl
end resizeControl
What I want to do is to have that slider with just two position on the left and the right, so when user moves it to the right it enable button for DB deletion ( or dome something ) and when it moves it back button gets disabled ( or other thing happen ).
Any help would be great, for sample code I will buy you a beer !