Here's code for a four corner street (signal) light. Make a three frame sprite bmp like this:
Attach stoplight1 to one light image and attach stoplight2 to the opposite light image. This code makes each light pause on red for a second just like like real lights.
ACTION stoplight2{
while (1) {
my.frame = zzz; wait (1);}
}
ACTION stoplight1{
while (1) {
my.frame = 1; zzz = 3; waitt (100); //green1-red2
my.frame = 2; waitt (40); //yellow1
my.frame = 3; waitt (20); //red1
zzz = 1; waitt (100); //green2
zzz = 2; waitt (40); //yellow2
zzz = 3; waitt (20); //pause2
wait(1);}
}