![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
flash as3.0 带有按钮的影片剪辑拖拽完整代码 ENTER_FRAME,startDrag(), stopDrag(), 20
一个影片剪辑mcone里有一张图片picone和一个按钮btnone。mcone可用鼠标控制左右拖动,且向左或向右拖动时,mcone是循环的。即mcone的左右两边是衔接...
一个影片剪辑mcone里有一张图片picone和一个按钮btnone。mcone可用鼠标控制左右拖动,且向左或向右拖动时,mcone是循环的。即mcone的左右两边是衔接在一起的。mcone的左边接mcone的右边,mcone的右边接mcone的左边。按钮btnone鼠标点击后跳转到mctwo里的某帧。在拖拽的过程中,鼠标在哪松开,mcone就停在哪。
以下是我找到一个写在影片剪辑上as1.0的代码,是我想要的效果。但是我想要as3.0的,可以发布flash player9.0以上的。
谢谢,答得好有加分。
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;
} 展开
以下是我找到一个写在影片剪辑上as1.0的代码,是我想要的效果。但是我想要as3.0的,可以发布flash player9.0以上的。
谢谢,答得好有加分。
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;
} 展开
展开全部
表示1.0的代码看不懂啊,现在都是3.0的啦,楼主可以去学学,3.0的非常好学的
追问
3.0肯定是要学得,我这不是应急嘛。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询