# Trouble getting element position

**URL:** <https://forum.kirupa.com/t/trouble-getting-element-position/106136>\
**Category:** Uncategorized\
**Created:** [April 2, 2004, 4:49pm UTC](https://forum.kirupa.com/t/trouble-getting-element-position/106136 "2004-04-02T16:49:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerium](https://avatars.discourse-cdn.com/v4/letter/z/85e7bf/32.png) [@zerium](https://forum.kirupa.com/u/zerium)\
**Post date:** [April 2, 2004, 4:49pm UTC](https://forum.kirupa.com/t/trouble-getting-element-position/106136/1 "2004-04-02T16:49:38Z")

</div>

I am trying to get the position of a form element (textInput component) inside a scrollpane… can anyone help with this?

```auto

var focusListener = new Object();
	focusListener.onSetFocus = function(oldFocus_txt, newFocus_txt) {
	  trace(newFocus_txt._x);
	  trace(newFocus_txt._y);
	}
	Selection.addListener(focusListener);

```

it returns the same number for all the elements…

thanks!

EDIT---------------

figured it out:

```auto

var focusListenerX = new Object();
	focusListenerX.onSetFocus = function() {
	  trace(_root.focusManager.getFocus()._y);
	}
	Selection.addListener(focusListenerX);

```
