I can’t see anything specifically wrong with your code, apart from storing object references which, if you take a look on these forums, does often lead to problems.
Can you outline what the game is like? Some pictures etc. What happens?
Maybe I can see something useful.
PS: Strangely enough, I have coded up something similar, and it seems to work fine. But I wouldn’t use object references in a packaged game. I really don’t know if that would work.