animOffset control. newbie help please

Hi, i’m new to programming: I want to control the frame of a movie displayed on a texture by altering the position of an empty (handle).

import Blender
from Blender import Window, Object, Texture, Material, Draw

f=32 #number of frames
ob = Object.Get(‘handle’) # control
if n<1: n==1
if n>f: n==f
n = “%d” % n
print n
tex = Texture.Get(‘Tex’)
tex.animOffset = n
Blender.Redraw( -1 )

08/04/2009 01:36:02 [0x0-0x152152].org.blenderfoundation.blender[3390] Traceback (most recent call last):
08/04/2009 01:36:02 [0x0-0x152152].org.blenderfoundation.blender[3390] File “Text.001”, line 12, in <module>
08/04/2009 01:36:02 [0x0-0x152152].org.blenderfoundation.blender[3390] TypeError: expected int argument in [-300000,300000]

python 2.5.?4
blender 2.48a for py 2.5
os x 10.5.6 PPC

i’m sure it’s something simple to do with formatting to integers but its beyond me.

help much appreciated.

getting there: inserted n=int(n) and switched to 2.45 as bug in 2.48a that switches to offset e.g. 10000 for no apparent reason.