Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : 75% works OK -- Need help ASAP


2s
1/15/2004 11:02:19 PM
I've got two sliders. They should not overlap, but rather push each other. I used HitTest and almost got it to work.

Open file and slide one way and then the other, and you'll see what the problem is, it's pretty obvious. Feel free to tweak the file.

File: Flash MX (not MX 2004)
File in MX 2004 is also available.

http://webforums.macromedia.com/attachments/sliders.zip

Juji
1/16/2004 5:28:33 PM
Try this:
left MC:
<
onClipEvent (enterFrame) {
var myWay =(_root.left.dragHandle._x>_root.Lx)? true : false;
_root.Lx = _root.left.dragHandle._x
if (_root.left.dragHandle, hitTest(_root.right)) {
if(myWay)_root.right.dragHandle._x = (_root.left.dragHandle._x + 5);
}
}
[quoted text, click to view]

right MC:
<
onClipEvent (enterFrame) {
var myWay =(_root.right.dragHandle._x < _root.Rx)? true : false;
_root.Rx = _root.right.dragHandle._x
if (_root.right.dragHandle, hitTest(_root.left)) {
if(myWay)_root.left.dragHandle._x = (_root.right.dragHandle._x - 5);
}
}
[quoted text, click to view]

:-) bye

[quoted text, click to view]


--
-----------------------------------------------------------
ENJOY THE SILENCE
-----------------------------------------------------------
flash@didesidero.com
www.didesidero.com
AddThis Social Bookmark Button