Hi Malcolm,
I think you're on a bit of the wrong track here.. You probably don't want a while loop at all; you need an IF statement to check if the ShotClk text is less than 10.. I assume your script is in OnSetText? If so, it will get called each time the shotclock value changes, so you only need to check if the current text is less than 10 then change the background..
Here is some psedo code to get you started..
if CInt(Text) < 10 then
GetMaterialByName("RED BG")
SetMaterial
else
GetMaterial("Not red bg")
SetMaterial
end if
If you are running version 5.5 you may also want to look at the Visual Logic feature. You can probably accomplish the same thing without having to write any scripting.
If you get stuck; try to post a link to your scene here and I or someone else on the forum might be able to help you get it working.
Brian
#XPression