Thursday, September 14, 2006

REALbasic Timer Controls

Someone on the RB Forums asked about using timers to control the coloring of some squares (what for, I have no idea). So I put together a sample that shows how I'd do it.

There's a six minute video detailing how to use REALbasic Timer Controls in your program.

Jay Jennings

tags technorati :

1 comment:

Unknown said...

just so you know there is a way easier way to do this

make an array of rectangles named rec and make their arrays 0,1,2,3 respectively

now make one timer name it masTimer
set its mode to 2

add two properties

colorBool as Boolean
and
currentSquare as integer

now under masTimer sub(action) put this code

if colorBool=True then
rec(currentSquare).FillColor=&c00FF00
currentSquare=currentSquare+1
if currentSquare > 3 then
currentSquare=0
colorBool=false
else
end if
else
rec(currentSquare).FillColor=&cFFFFFF
currentSquare=currentSquare+1
if currentSquare > 3 then
currentSquare=0
colorBool=true
else
end if
end


voila! blinking boxes with way less garbage