# Help with calculating

**URL:** https://forum.kirupa.com/t/help-with-calculating/288959
**Category:** flash
**Created:** [May 24, 2009, 2:40am UTC](https://forum.kirupa.com/t/help-with-calculating/288959 "2009-05-24T02:40:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![evbarkley9](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@evbarkley9](https://forum.kirupa.com/u/evbarkley9)
#### Post date: [May 24, 2009, 2:40am UTC](https://forum.kirupa.com/t/help-with-calculating/288959/1 "2009-05-24T02:40:23Z")

</div>

If I have a mask that say is 200px tall. The object it is masking(call it listObject) can vary in height 200px to say 600(doesnt really matter).

I have a button that when I scroll over I would like it to move the ListObject along the y axis but only to the bottom of the mask. So the last object in the list is revealed and it stops scrolling so to speak.

How can I calcuate the y position on scroll over.

I know I can start by creating variables for the mask.height and listObject.height, but dont know how to use them to calculate.

Does anyone know how to do this?

Thanks in advance.
