# Trying to understand the “Menu with Slider” code

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:

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.