Trying to make an Oval move left when left key is pressed

Hello! Really new with Xojo so I would appreciate any help I could get :slight_smile:

I have an oval (oval1) and I am trying to make it go left when the user presses the left key, and make it go right when the user presses the right key.

I made a keydown event handler, and this is the code I put in it.

[code] dim ovalpos as integer
ovalpos = oval1.left
if asc(key) = 28 then

ovalpos - 5

return true

elseif asc(key) = 29 then

ovalpos + 5

return true

end if[/code]

When I test this out though, it says that it is unable to do it because ovalpos is not an array. I don’t really understand what that means. Thanks in advance for any help!
(ps. Sorry if my english isn’t very good, it’s not my native language.)

 ovalpos = ovalpos - 5

Thank you very much, I can’t believe it was that simple! :slight_smile:

Note that you’ll need to actually do something with the new ovalpos value – such as assign it back to oval.left to make it move.