local axis for shadows

Does anyone know of a way to make a shadow object on the local z axis instead of global? I think you’d need a ray sensor with some kind of getDistance script, but I can’t figure it out. Thanks.

I feel lonely replying to my own post, but maybe I should explain what I need this for. Well, it could be used for a lot of things. The shadow could track a lamp (so the shadow would be on a wall if it was level with the light source), it could be used to make laser points, have a dynamic cursor over objects or whatever.

Well to stop you feeling lonely I would look at this thread for shadows http://blenderartists.org/forum/showthread.php?t=110915 but apart from that I’m not clever enough to answer your question.