xmattx
July 15th, 2003, 08:40 PM
im using this
onClipEvent (load) {
speed = 5;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// /////////////
if (_root.hitbar._x>_root._xmouse) {
_root.hitbar._x = _root.hitbar._x-((_root.hitbar._x-_root._xmouse)/speed);
}
}
if (_root.hitTest(_root._xmouse, _root._ymouse)) {
if (_root.hitbar._x<_root._xmouse) {
_root.hitbar._x = _root.hitbar._x+((_root._xmouse-this.hitbar._x)/speed);
// /////////////////////////
}
}
}
however I cant get the script to work
Im placing this script on a movie clip, there is a second MC whose instance name is "hitbar" and when the mouse hits this MC it should trigger the first MC to travel along the X axis...
any help?
thanks!
onClipEvent (load) {
speed = 5;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// /////////////
if (_root.hitbar._x>_root._xmouse) {
_root.hitbar._x = _root.hitbar._x-((_root.hitbar._x-_root._xmouse)/speed);
}
}
if (_root.hitTest(_root._xmouse, _root._ymouse)) {
if (_root.hitbar._x<_root._xmouse) {
_root.hitbar._x = _root.hitbar._x+((_root._xmouse-this.hitbar._x)/speed);
// /////////////////////////
}
}
}
however I cant get the script to work
Im placing this script on a movie clip, there is a second MC whose instance name is "hitbar" and when the mouse hits this MC it should trigger the first MC to travel along the X axis...
any help?
thanks!