Not a bad idea. Making it retract might be an issue though,
My friend sent me a link to
this site which is apparently all about solenoids. I just don't know how powerful and fast the action of them is.
EDIT:
Daox, A thought just came to as to why not. AC vs. DC. Oops. Good idea though.