发新话题
打印

梵天,可否帮我分析一下下面的代码啊,应该是控制游标滑动的

梵天,可否帮我分析一下下面的代码啊,应该是控制游标滑动的

onClipEvent (load) {
    acscriptmouse = 100;
    dustymouse = 100;
    outragedmouse = 100;
    divfactor = 6;
}
onClipEvent (enterFrame) {
if (((_root.acscript._y - 15) < _root._ymouse) && (_root._ymouse < (_root.acscript._y + 15))) {
acscriptdist = Math.abs(_root._xmouse - _root.acscript._x);
acscriptmouse = _root._xmouse;
if (_root.acscript._x < _root._xmouse) {
_root.acscript._x = _root.acscript._x + (acscriptdist / divfactor);
}
if (_root._xmouse < _root.acscript._x) {
_root.acscript._x = _root.acscript._x - (acscriptdist / divfactor);
}
}
if (((_root.acscript._y - 15) >= _root._ymouse) || ((_root.acscript._y + 15) < _root._ymouse)) {
acscriptdist = Math.abs(acscriptmouse - _root.acscript._x);
if (_root.acscript._x < acscriptmouse) {
_root.acscript._x = _root.acscript._x + (acscriptdist / divfactor);
}
if (acscriptmouse < _root.acscript._x) {
_root.acscript._x = _root.acscript._x - (acscriptdist / divfactor);
}
}
if (((_root.dusty._y - 15) < _root._ymouse) && (_root._ymouse < (_root.dusty._y + 15))) {
dustydist = Math.abs(_root._xmouse - _root.dusty._x);
dustymouse = _root._xmouse;
if (_root.dusty._x < _root._xmouse) {
_root.dusty._x = _root.dusty._x + (dustydist / divfactor);
}
if (_root._xmouse < _root.dusty._x) {
_root.dusty._x = _root.dusty._x - (dustydist / divfactor);
}
}
if (((_root.dusty._y - 15) >= _root._ymouse) || ((_root.dusty._y + 15) < _root._ymouse)) {
dustydist = Math.abs(dustymouse - _root.dusty._x);
if (_root.dusty._x < dustymouse) {
_root.dusty._x = _root.dusty._x + (dustydist / divfactor);
}
if (dustymouse < _root.dusty._x) {
_root.dusty._x = _root.dusty._x - (dustydist / divfactor);
}
}
if (((_root.outraged._y - 15) < _root._ymouse) && (_root._ymouse < (_root.outraged._y + 15))) {
outrageddist = Math.abs(_root._xmouse - _root.outraged._x);
outragedmouse = _root._xmouse;
if (_root.outraged._x < _root._xmouse) {
_root.outraged._x = _root.outraged._x + (outrageddist / divfactor);
}
if (_root._xmouse < _root.outraged._x) {
_root.outraged._x = _root.outraged._x - (outrageddist / divfactor);
}
}
if (((_root.outraged._y - 15) >= _root._ymouse) || ((_root.outraged._y + 15) < _root._ymouse)) {
outrageddist = Math.abs(outragedmouse - _root.outraged._x);
if (_root.outraged._x < outragedmouse) {
_root.outraged._x = _root.outraged._x + (outrageddist / divfactor);
}
if (outragedmouse < _root.outraged._x) {
_root.outraged._x = _root.outraged._x - (outrageddist / divfactor);
}
}
}

TOP

Re:梵天,可否帮我分析一下下面的代码啊,应该是控制游标滑动的

你把源文件贴上去。能多吸引一点目光。每句的意思也能懂,但连起来就不明了。:)

TOP

发新话题