# Setting various x and y co-ords for a movieclip with buttons

**URL:** <https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607>\
**Category:** Uncategorized\
**Created:** [July 2, 2003, 6:11pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607 "2003-07-02T18:11:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashDeano](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@FlashDeano](https://forum.kirupa.com/u/FlashDeano)\
**Post date:** [July 2, 2003, 6:11pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/1 "2003-07-02T18:11:53Z")

</div>

I have a movie clip, behind a mask, and I am trying to control the position it moves to, dependent on the menu button pressed.

If I am honest I am trying to copy the effect used in [www.lostinbeta.com](http://www.lostinbeta.com) when pages are loaded.

I have got everything working, but currently I do not know how to set the finishing x position depending on the button pressed.

I think the issue is becuase I am trying to use the technique to make the movement slowdown as it reaches its correct co-ordinates.

If this doesn’t make sense please ask and I will upload the fla.

Regards  
Flashdeano

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2003, 7:45pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/2 "2003-07-02T19:45:20Z")

</div>

Oh, I believe you are talking about easing. Stick these two prototypes in a frame on the main stage:

```auto
MovieClip.prototype.easeToObj = function (obj, ease) {
this.onEnterFrame = function () {
this._x += (obj._x-this._x)/ease;
this._y += (obj._y-this._y)/ease;
};
};

MovieClip.prototype.easeToLoc = function (x, y, ease) {
this.onEnterFrame = function () {
this._x += (x-this._x)/ease;
this._y += (y-this._y)/ease;
};
};

```

Now, how these work…since these functions are both MovieClip prototypes, they only work with movieclips for the time being.  
The way these functions work, is depending on which one you call, you basically tell it where to go. For example, with easeToObj, the first parameter is an object, which can be anything (movieclip, button, etc). The second parameter is the ease scale. You want to keep it at a value greater than or equal to 2. Setting it at one will basically move it there automatically. The higher the ease value, the slower it takes for the object that calls that function to get to where it’s going.  
Now the second function I have there works the same, only you give it a position to go to in (x, y) coordinates. The ease parameter remains the same.

I hope these become useful.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2003, 7:47pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/3 "2003-07-02T19:47:37Z")

</div>

[http://www.kirupa.com/developer/flash5/slidingmenu.htm](http://www.kirupa.com/developer/flash5/slidingmenu.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2003, 7:53pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/4 "2003-07-02T19:53:46Z")

</div>

^^ what sinister said

Nice footer btw sinister 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2003, 8:01pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/5 "2003-07-02T20:01:36Z")

</div>

Thanks :beam:

lostinbeta - Don’t you just hate it when members won’t search the site and past forum threads for their problems?

😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2003, 10:00pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/6 "2003-07-02T22:00:49Z")

</div>

Well, I think the reason is that since this is a help forum, anybody could post a question anytime; yet that is a contradiction which they fail to notice. If a person wants to ask a question, he/she completely ignores the fact that others are also seeking help and that some may have already asked the same question before.

It’s also a psychological thing, if one seeks help for his or her own benefit, there is little chance that person has any regard to anyone but himself for the moment. But if you want people to search before posting, you should tell them when they sign up or whatever.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 3, 2003, 7:01am UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/7 "2003-07-03T07:01:02Z")

</div>

Thanks for your feedback.

I did search the forums howeve, I am new to actionscript and flash mx, and whilst I know what I am trying to do, the terms I use to describe it, are not always those that the particular posts use as their references.

My initial question really was how do I pass a value (the endx position) to a movieclip when a button is pressed.

I have since worked it by calling a function inside the onRelease and the function has the value defined.

It isn’t easy to find the relevant post when you really don’t know what you are doing. I am trying to learn, will hopefully get better and will spend longer searching next time.

Is there anyway to receive all messages from all posts by email, as reading all of these will help me learn more.

Apologies for annoying you all.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 3, 2003, 4:09pm UTC](https://forum.kirupa.com/t/setting-various-x-and-y-co-ords-for-a-movieclip-with-buttons/24607/8 "2003-07-03T16:09:12Z")

</div>

Sintax Sinister (if that is your real name ;)): 😛

lorcas: makes sense

Flash Deano: It makes sense that you didn’t know what to search for, we are just messing with your head because you posted the question and waited for an answer when really the answer was right in front of you in the tutorials at [kirupa.com](http://kirupa.com) 🙂

> Is there anyway to receive all messages from all posts by email, as reading all of these will help me learn more.

I am not sure I understand what you mean there? Can you explain? 🙂
