type/variable error

Blitz3D Forums/Blitz3D Beginners Area/type/variable error


Function explode_target(id)
	
Local target.target=Null

target=get_target_id.target(id)

target\image=explosion
frame=1
				
While frame<10

Cls

DrawImage gfx_back,0,0
DrawImage explosion,target\x,target\y,frame
If id <> 1 Then DrawImage target_1\image,target_1\x,target_1\y
;If id <> 2 Then DrawImage target_2\image,target_2\x,target_2\y
;If id <> 3 Then DrawImage target_3\image,target_3\x,target_3\y	
DrawImage mouse_crosshair_image, MouseX(), MouseY()
Text(0,0,"id=" +id)
;WaitMouse
Delay(50)
Flip
frame=frame+1
				
Wend



Can anyone explain why the line 'if id<>1 etc' gives me a 'variable must be a type' error? The 3target objects are created and the program works fine if i add ';' to this line of code. I thought that type objects are global yet this function doesnt seem to see them
thanks