Put this at the beginning of your dynamic light's action:
Code:
if(my.flag7 == on)
{
my.cast = on;
}
else
{
my.cast = off;
}
Change the "flag7" to whatever best suits your code. Make sure the one with color 0,0,0 has its flag set.
If your light action has a loop, place that code before the loop. No sense in checking that each frame. Also, make sure the player's origin actually enters the light's range. Try giving it a huge one for testing purposes. When I first started out, it would never work since I wasn't making the range large enough.