![]() |
#1 |
初級會員
![]() ![]() 注冊日期: 12-12
帖子: 1
現金:5金幣
資產:5金幣
![]() |
![]()
var slideNum = 7; var frameTimer = 200; var speed = 0.3; var imgWidth = this.slideImg._width/slideNum; ///////////////////////////// // /////////////////////////////////////////////////////////////////////// // var slideOver = 0; function slideMove() { this.slideImg._x += speed*((targetx-1)-this.slideImg._x); } function slideSystem() { for (var i = 1; i<=slideNum; i++) { if (slideOver == i) { if (this["slideMc"+i]._currentframe < this["slideMc"+i]._totalframes) { this["slideMc"+i].nextFrame(); targetx = -imgWidth*(i-1); } } else { if (this["slideMc"+i]._currentframe>1) { this["slideMc"+i].prevFrame(); } } } } MovieClip.prototype.imgRollOver = function() { mouseOver = true; }; MovieClip.prototype.imgRollOut = function() { mouseOver = false; }; MovieClip.prototype.btnRollOver = function() { slideOver = this._name.slice(7); mouseOver = true; }; MovieClip.prototype.btnRollOut = function() { mouseOver = false; }; mouseOver = false; this.onEnterFrame = function() { slideMove(); slideSystem(); if (mouseOver == false) { if (timer++%frameTimer == 0) { if (slideOver == slideNum) { slideOver = 0; } slideOver++; } } }; 問題:1、targetx = -imgWidth*(i-1); 為什么是 -imgWidt 2、MovieClip.prototype.imgRollOver = function() { mouseOver = true; }; MovieClip.prototype.imgRollOut = function() { mouseOver = false; }; MovieClip.prototype.btnRollOver = function() { slideOver = this._name.slice(7); mouseOver = true; }; MovieClip.prototype.btnRollOut = function() { mouseOver = false; };這幾句的“=”前面的內容是什么意思呢? 3、if (timer++%frameTimer == 0) 是什么意思呢?timer是從哪來的。 先謝謝了?。?! |
![]() ![]() |
![]() |