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