Could you post your code? It'd be easier for us to understand what your problem is.

From reading what it is you had written, I think it might work (not likely, though) if you move the variable...