# How read button or image position into a numeric variable with scripting?

**URL:** <https://forum.kirupa.com/t/how-read-button-or-image-position-into-a-numeric-variable-with-scripting/192411>\
**Category:** Uncategorized\
**Created:** [June 28, 2006, 12:54pm UTC](https://forum.kirupa.com/t/how-read-button-or-image-position-into-a-numeric-variable-with-scripting/192411 "2006-06-28T12:54:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acony](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Acony](https://forum.kirupa.com/u/Acony)\
**Post date:** [June 28, 2006, 12:54pm UTC](https://forum.kirupa.com/t/how-read-button-or-image-position-into-a-numeric-variable-with-scripting/192411/1 "2006-06-28T12:54:23Z")

</div>

I can figur out why this doesn’t work.

\_global.oldpos = 0.0; // Declares global variable

onEnterFrame ()  
{  
var newpos:Number;  
trace (“Running…”);  
//newpos = 101;  
// newpos = Map.\_y; \<— NaN dosn’t work why  
newpos = oldpos + 1;  
Map.\_y = newpos;  
oldpos = newpos;  
trace (newpos);  
}

Map is the Layer containing the bit map or button that I need to read position from  
What should I do to let this map move on my script commands?

Regards

L.
