[Resolved] Changing a objects x coordinate with a variable.

Hey all,

I was wondering if it would be possible to change a display objects x coordinates using something of a pointer referring to it. Below is a example of what I want to do but it isn’t working.

thanks,

Chris

[lua]local object = display.newCircle(10, 10, 10);

local pointer = object;

pointer.x = 100; – This should move the objects x cordinates. [import]uid: 126017 topic_id: 29844 reply_id: 329844[/import]

Your code will work. [import]uid: 160496 topic_id: 29844 reply_id: 119670[/import]

If that code isn’t working then ‘object’ might be a reserved word. Try changing it to obj or something more descriptive. [import]uid: 147305 topic_id: 29844 reply_id: 119673[/import]

Works fine on 840 on Mac. [import]uid: 52491 topic_id: 29844 reply_id: 119713[/import]

hey I found my problem. My code actually looked more like what is below which was causing the problem. Thank you everyone for the quick responses.

[lua]local object;

local one;

object = display.newCircle(10, 10, 10);

one.x = 100; [import]uid: 126017 topic_id: 29844 reply_id: 119767[/import]

Your code will work. [import]uid: 160496 topic_id: 29844 reply_id: 119670[/import]

If that code isn’t working then ‘object’ might be a reserved word. Try changing it to obj or something more descriptive. [import]uid: 147305 topic_id: 29844 reply_id: 119673[/import]

Works fine on 840 on Mac. [import]uid: 52491 topic_id: 29844 reply_id: 119713[/import]

hey I found my problem. My code actually looked more like what is below which was causing the problem. Thank you everyone for the quick responses.

[lua]local object;

local one;

object = display.newCircle(10, 10, 10);

one.x = 100; [import]uid: 126017 topic_id: 29844 reply_id: 119767[/import]