# A little help please

**URL:** <https://forum.kirupa.com/t/a-little-help-please/17081>\
**Category:** Uncategorized\
**Created:** [April 1, 2003, 4:38am UTC](https://forum.kirupa.com/t/a-little-help-please/17081 "2003-04-01T04:38:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tee28](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@tee28](https://forum.kirupa.com/u/tee28)\
**Post date:** [April 1, 2003, 4:38am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/1 "2003-04-01T04:38:15Z")

</div>

hi guys/girls,  
i’m having a little trouble with my site.

function: a radio icon that allows the slider of tracks to come out on rollover. then on (press) of any of the track numbers, the slider slides back in.

problem: the script that i have for the icon that opens the slider is: on (rollOver) {  
\_root.xpos = \_root.radio.slider.\_x+(1.75)\*100/2;  
}

but the problem i’m having is that if you rollover the icon again while the slider is out, it’ll add the value to it’s current position.  
how would i say if the position of the slider is ‘this value’, don’t slide anymore. here’s a visual reference.

[http://triggerme.com/test](http://triggerme.com/test)

i hope i’ve been cleared. thanks in advance.

---

<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:** [April 1, 2003, 5:56am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/2 "2003-04-01T05:56:53Z")

</div>

Rather than indicating a ‘distance to travel’…

I would think that rather than trying to get it to _not slide anymore_ afterwards - you should designate a specific _x & y_ coordinate that you want it to go to for each event (rollover, click)…

If slider is allready ‘at’ those positions - no action would occur on subsequent duplicate events

…methInks

would be far less code

---

<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:** [April 1, 2003, 6:04am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/3 "2003-04-01T06:04:03Z")

</div>

I believe you can use hitText for this. Just apply this to your button:[AS]onClipEvent (enterFrame) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
\_root.xpos = \_root.radio.slider.\_x+(1.75)\*100/2;  
} else {  
\_root.xpos = \_root.radio.slider.\_x-(1.75)\*100/2;  
}  
}  
[/AS]  
So on rollOver, it will move the slider to the right then on rollOut, it will move the slider back to the left. I didn’t test it out so I’m not sure if it will work or not, but it’s worth a shot. =)

---

<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:** [April 1, 2003, 6:06am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/4 "2003-04-01T06:06:09Z")

</div>

open icon AS:

```auto
on(rollOver) {
_root.radio.slider.gotoX = startX+(1.75)*100/2;
}

```

slider AS:

```auto
onClipEvent(load) {
startX = _x
ease = 10
}
onClipEvent(enterFrame) {
_x += (gotoX-_x)/ease
}

```

tell me if it works…

---

<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:** [April 1, 2003, 6:18am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/5 "2003-04-01T06:18:45Z")

</div>

EG: I think he wanted to have the slider remain out until one of the choices was clicked (?) …

---

<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:** [April 1, 2003, 9:42am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/6 "2003-04-01T09:42:45Z")

</div>

😑

---

<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:** [April 1, 2003, 9:48am UTC](https://forum.kirupa.com/t/a-little-help-please/17081/7 "2003-04-01T09:48:38Z")

</div>

> \*Originally posted by RelandR \*  
> \*\*EG: I think he wanted to have the slider remain out until one of the choices was clicked (?) … \*\*

Oh shoot, you’re right, I thougt he wanted it to slide in and out. :!:

---

<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:** [April 1, 2003, 1:16pm UTC](https://forum.kirupa.com/t/a-little-help-please/17081/8 "2003-04-01T13:16:55Z")

</div>

is my AS correct then???

---

<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:** [April 1, 2003, 3:18pm UTC](https://forum.kirupa.com/t/a-little-help-please/17081/9 "2003-04-01T15:18:00Z")

</div>

hey guys,  
thanks for the help. i found the easiest way was just adding the \_x position value to the MC. now it works.

thanks to all that helped.
