Sg2.9
Accessing x and y values of o...
Recent RSS
Accessing x and y values of objects in getItems array?
Date:  22. June 2011, 00:06

Hi there

Is it possible to access the x and y values for items in a getItems array? I’d like to do something like:

var found = document.getItems({selected: true});
for(i = 0; i < found.length; i++){
var myX = found[i].x;
var myY = found[i].Y;

}

I’d appreciate any insights.

Re: Accessing x and y values of objects in getItems array?
Date:  22. June 2011, 02:50

Ah, I worked out that I can use found[i].position instead.

Hypothetically, though, I’d still be interested to hear if there’s a way to access the x and y values individually.

Re: Accessing x and y values of objects in getItems array?
Date:  22. June 2011, 18:16

item.position is a Point object.

You can access item.position.x and item.position.y

Re: Accessing x and y values of objects in getItems array?
Date:  22. June 2011, 18:30

Ah! Thank you.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Hexagonal Grid Generator 16.11.11