主题:  帮忙看看这段代码!请高手详细解释一下。

yushilei

职务:普通成员
等级:1
金币:0.0
发贴:96
#12003/3/12 7:51:25
onClipEvent (load) {
    mouse = this._xmouse;
    mouseDrag = this._xmouse;
    dragging = false;
    movieWidth = this._width;
    movieCenter = 0;
    noOfFrames = this._totalFrames;
    currentFrame = this._currentFrame;
    gotoAndStop (1);
}
onClipEvent (enterFrame) {
    frameToGoto = currentFrame-Math.round(((mouseDrag-mouse)/10));
    if (hitTest(_root._xmouse, _root._ymouse, false)) {
        mouseDrag = this._xmouse;
        if (dragging) {
            if (frameToGoto>=1 && frameToGoto<=noOfFrames) {
                this.gotoAndStop(frameToGoto);
            }
            if (frameToGoto<1) {
                frameToGoto += noOfFrames;
                this.gotoAndStop(frameToGoto);
            }
            if (frameToGoto>noOfFrames) {
                frameToGoto -= noOfFrames;
                this.gotoAndStop(frameToGoto);
            }
        }
    }
}
onClipEvent (mouseDown) {
    mouse = this._xmouse;
    if (hitTest(_root._xmouse, _root._ymouse, false)) {
        dragging = true;
    }
}
onClipEvent (mouseUp) {
    dragging = false;
    currentFrame = this._currentFrame;
}
onClipEvent (keyDown) {
    if (Key.isDown(109)) {
        this._xscale--;
        this._yscale--;
    }
    if (Key.isDown(107)) {
        this._xscale++;
        this._yscale++;
    }
    // updateAfterEvent();
}



Mozier

职务:管理员
等级:5
金币:11.0
发贴:2994
#22003/3/12 8:46:40
转flashdev