The result is that field 1 starts scrolling correctly from the start of its content, but field 2 starts from where field 1 is up to in it's processing (the EaseInOut effect) and then field 3 also starts from where field 1 is up to in its processing (which is nearly at the end of processing). They all finish nearly at the same time. My intention is to create 3 fields which scroll like a slot machine/poker machine with 3 spinning columns (scrolling fields) which start and stop independently (but are actually spinning at the same time - like a poker machine.
On the card I have 2 buttons:
- "Add Content" button which populates the scrolling fields
"Start" button which has the main processing code
Code: Select all
## "Add content" button on card ## Populate scrolling fields with numbers 1 to 50 on mouseUp repeat with x = 1 to 50 put x into line x of fld "EaseInOut1" put x into line x of fld "EaseInOut2" put x into line x of fld "EaseInOut3" end repeat end mouseUp ## "Start" button on card local lMax1,lMax2, lMax3, lMillisecs on mouseUp put the formattedHeight of fld "easeInOut1" - the height of fld "easeInOut1" into lMax1 put the formattedHeight of fld "easeInOut2" - the height of fld "easeInOut2" into lMax2 put the formattedHeight of fld "easeInOut3" - the height of fld "easeInOut3" into lMax3 disable me put the milliseconds into lMillisecs send "goEase1" to me in 0 millisecs send "goEase2" to me in 500 millisecs send "goEase3" to me in 1000 millisecs end mouseUp on goEase1 put the milliseconds-lMillisecs into tCurrentTime1 set the vScroll of fld "easeInOut1" to round(aeEaseInOut(0,lMax1,2000,tCurrentTime1,3)) if tCurrentTime1 <= 2000 then send goEase1 to me in 20 milliseconds else enable me end if end goEase1 on goEase2 put the milliseconds-lMillisecs into tCurrentTime2 set the vScroll of fld "easeInOut2" to round(aeEaseInOut(0,lMax2,2000,tCurrentTime2,3)) if tCurrentTime2 <= 2500 then send goEase2 to me in 20 milliseconds else enable me end if end goEase2 on goEase3 put the milliseconds-lMillisecs into tCurrentTime3 set the vScroll of fld "easeInOut3" to round(aeEaseInOut(0,lMax3,2000,tCurrentTime3,3)) if tCurrentTime3 <= 3000 then send goEase3 to me in 20 milliseconds else enable me end if end goEase3
Screenshot of Card attached. Any help much appreciated!