I'm not sure your description of what you want to do matches what Greg suggested. Are you just trying to toggle a motor between on and off each time you press a joystick button? There are plenty of posts here explaining how to do that; just search "button toggle motor". Here's one that looks particularly straightforward:
http://www.chiefdelphi.com/forums/sh...02&postcount=5