If I have unterstand correctly what you want, something like this?
When the mouse is over the tile (which size I fixed in 16x16 pixels - see the MOuseX()... line) the frame counter is activated else is stopped.
Type ttile Field x:Int , y:Int Field frame:Int , frame_start:Int , frame_end:Int , frame_delay:Int Field frame_timer:Int Field mouse_is_over:Int=0 Function create:ttile(xx:Int , yy:Int , fstart:Int = 0,fend:Int=5) Local t:ttile = New ttile t.x = xx t.y = yy t.frame = fstart t.frame_start = fstart t.frame_end=fend t.frame_delay = 125 t.frame_timer = MilliSecs() Return t End Function Method Update() If MouseX() > x And MouseX() < x + 15 And MouseY() > y And MouseY() < y + 15 mouse_is_over = 1 Else mouse_is_over = 0ù If mouse_is_over=1 'the mouse is on the tile If MilliSecs() > frame_timer + frame_delay frame:+ 1 If frame > frame_end frame = frame_start frame_timer = MilliSecs() End If End If 'drawmimage frame.... SetColor 128 , 128 , 128 DrawRect x , y , 15 , 15 SetColor 255 , 255 , 255 DrawText frame , x , y End Method End Type Graphics 640 , 480 Local arr:ttile[10 , 10] 'initialize new array For x1 = 0 Until 10 For y1 = 0 Until 10 arr[x1 , y1] = ttile.Create(x1*16 , y1*16) Next Next While Not AppTerminate() Cls For x1 = 0 Until 10 For y1 = 0 Until 10 arr[x1 , y1].update Next Next Flip Wend
When the mouse is over the tile (which size I fixed in 16x16 pixels - see the MOuseX()... line) the frame counter is activated else is stopped.