blinking text in list fields

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gregmiller
Posts: 14
Joined: Wed Dec 13, 2006 6:09 am

blinking text in list fields

Post by gregmiller » Wed Dec 13, 2006 5:22 pm

I am trying to have certain lines in a list field have blinking text or blinking colored backgrounds. I can make this happen by setting the hilitecolor and then selecting and deselecting the line(s) I want to blink. However, this is unweildy and when put in a handler that runs regularly, slows the app down to a crawl.

What I am trying to achieve here is similar to what you might see behind the counter at a fast food restaurant where the people who prepare the food look up at a monitor and see a list of orders. Some items are blinking to catch their attention. I need this to happen in a list field (I think) because I will be constantly adding and deleting items to the list.

I thought an alternative would be to put a little animated GIF next to the lines I want to hilite (not unlike the little emoticons I see on this forum), but cannot see how to add graphics to lines in a field.

Any thoughts?

Jock McTartan
Posts: 5
Joined: Tue Jul 25, 2006 12:38 pm

Flashing lines

Post by Jock McTartan » Wed Dec 13, 2006 6:14 pm

Try this in the script of a scrolling list
Send "toggleFlash" to the field to turn it on/off.
Set the 'uFlashList' custom property to a list of lines from the list field, example "1,3,4,5" - would flash lines 1,3,4 and 5.

Hopefully this will give you some ideas.

JC

Code: Select all

on toggleFlash
  if the uFlash of me = empty then set the uFlash of me to false
  set the uFlash of me to not the uFlash of me
  if the uFlash of me then flash
end toggleFlash

on flash
  put the uFlashColor of me into tColor
  if tColor = "255,0,0" then
    put "255,255,0" into tColor
  else
    put "255,0,0" into tColor
  end if
  set the uFlashColor of me to tColor
  repeat for each item tItem in the uFlashList of me
    set the backgroundColor of line tItem of me to tColor
  end repeat
  if the uFlash of me then send "flash" to me in 1 second
end flash


Free animation tools - http://molekular.co.uk/

Post Reply