# Trying to understand the “Menu with Slider” code

**URL:** https://forum.kirupa.com/t/trying-to-understand-the-menu-with-slider-code/65263
**Category:** Uncategorized
**Created:** [September 24, 2004, 2:47pm UTC](https://forum.kirupa.com/t/trying-to-understand-the-menu-with-slider-code/65263 "2004-09-24T14:47:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![iko\_designbynoa](https://avatars.discourse-cdn.com/v4/letter/i/c6cbf5/32.png) [@iko\_designbynoa](https://forum.kirupa.com/u/iko_designbynoa)
#### Post date: [September 24, 2004, 2:47pm UTC](https://forum.kirupa.com/t/trying-to-understand-the-menu-with-slider-code/65263/1 "2004-09-24T14:47:44Z")

</div>

Hi,

As I was trying to understand the “Menu with Slider” code, I have few questions:

a) Code(action script –general) :this.\_x += (xMove1-this.\_x)/easeSpeed;  
a. I could not find “xMove1” variable anywhere?! Who this variable belongs to?  
b. As I read in the flash dictionary “this” refer to slider\_mc instance “slider” (that have a script). Would that mean that I could have changed the code to: slider.\_x += (xMove1-slider.\_x)/easeSpeed? I would have tried this myself, but remarking out that line of code (see a.), seems to have no effect on the performance, therefore I could not see any difference anyway.  
b) Code (slider instance): \_x += (xMove-\_x)/easeSpeed;  
a. Again consulting with the dictionary, I have came to the conclusion that: the line above equals to: x = x + (xb-x)/a, where:  
i. Stating Movie case

1. x = \_x (which in this case is the X coordinate of the slider instance on the stage)
2. xb = xMove (which in this case is the variable that holds the X coordinate of the slider instance on the stage or the button we roll over)
3. a = easeSpeed (which in this case is a constant holding 5)  
a. If my equation assumption is correct then:  
i. x = xb i.e. we have not roll over any button  
ii. ?x = x + (xb -x)/a ? y=y , we will not move  
ii. Roll over button 2
4. xb = 182.9 (button 2 x location)
5. x= 98.2
6. ?x = 98.2 + (182.9-98.2)/5 = 115.14  
Now I get confused, what that means? Where is the new coordinate? It is not the xb location of button 2?

Please help

Thanks in advance

Iko Ben-Giat

:h: :h:

---

<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: [September 24, 2004, 6:48pm UTC](https://forum.kirupa.com/t/trying-to-understand-the-menu-with-slider-code/65263/2 "2004-09-24T18:48:55Z")

</div>

I’m at work now so I don’t really have time to pick the code apart but most of the times the expressions like \_xmouse and others are already coded into Flash as givens, meaning Flash knows what they mean without assigning them as variables.

Most of the time I just open up the Help section that is in the Actions Panel and look through there for common expressions I see everyone use and learn them and their uses.

Just my 2 cents.
