My null image a simple problem

BlitzMax Forums/BlitzMax Beginners Area/My null image a simple problem

I seem to be missing something very simple here.
I get the "attempted to access Null object" when my
program gets here:

		DrawImage scenery[3].image,90,90  'this works: the image is drawn
		Flip
		WaitKey
		Local temp = LockImage(scenery[3].image) 
		For Local y = 128 To 0 Step -1    
			WritePixel(temp,0,y,-19540200)  'draw a bright yellow line down the left side of the image
		Next
		UnlockImage(temp) '<-  error here.  Now it's Null....what's going on here?


Can anyone spot my obvious error?

Oh. After 45 minutes...

UnlockImage(temp) should = UnlockImage(scenery[3].image)

Lovely. Sorry for the trouble, fellows.

How'd you find this one out?

Reading the help and examine the examples in it on how to use commands if you don't understand it so far.

Beside: Use local temp:TPixmap instead of local temp. Will make it faster.

Matt, I'm not sure if that's sarcasm and therefore, if I should answer.

lol.