Flashing 3 leds together for one cycle with respect to thier input....

I suggest to use interrupts to blink the LEDs. See my POV experiment Persistence of Vision | Blinkenlight for an example. The idea would be to read the sensors in the main loop and then just tell the interrupt part the desired blink pattern. Passing the data between those two parts would be done by means of "volatile" variables.

For an example how to handle the communication between an interrupt driven part and the main loop have a look at my second VU meter example (at the bottom of the page): VU Meter | Blinkenlight.