I gave up the continuous event using on touching because it is just too fast to be able to stop at the correct time that needs to match the question. Instead I increment or decrement by 5 and rotate 30 degrees for minutes and 2.5 degrees for hours. Both are going at the same time like a regular clock.
This is different than setting up a clock for which there is a tutorial on this forum which I just discovered.
https://www.scirra.com/tutorials/1450/v ... -24h-clock
Since the student is the one who moves the hands the setup has to be different. I have a down button to go counterclockwise and a up button to go clockwise.
This was more complicated than just setting up a digital clock that goes only clockwise on its own.
I found the anwser for this if it helps someone. I decided to use only minutes in the background to make checking variables easier. Then I convert the time for the digital clock that is needing to be the same as the analog clock.
Global variables
hourText
minuteText
// conversion
set hourtext to int(timer/60)
set minuteText to int(timer % 60)[/code:5ox8tjk7]
1- I check to see if the time chosen is AM or PM.
2- The starting point has to be checked depending on AM or PM (see below)
3- for the display I use this on every tick:
[code:5ox8tjk7]if hourtxt <12 then set text to right("00" & hourText,2) & ":" & right("00" & minuteTxt,2) & " " & timeChoice
if hourtxt >11 then set text to right("00" & hourText-12,2) & ":" & right("00" & minuteTxt,2) & " " & timeChoice[/code:5ox8tjk7]
So now it is all working.
Resetting the timer variable in order to have the correct start time depending on AM or PM
[code:5ox8tjk7]// global variables:
timeChoice = ""
timer = 0
//UP/Clockwise button:
if timer = 0 and timeChoice = "AM" set timer to 0
if timer = 0 and timeChoice = "PM" set timer to 720
//DOWN/Counterclockwise buttton:
if timer = 0 and timeChoice = "AM" set timer to 720
if timer = 0 and timeChoice = "PM" set timer to 1440
if timer = 720 and timeChoice = "PM" set timer to 1440[/code:5ox8tjk7]