A little help please

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

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

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

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. =)

open icon AS:

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

slider AS:

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

tell me if it works…

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

:expressionless:

*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. :!:

is my AS correct then???

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.