FLASH 鼠标跟随问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 08:51:19
function outit()
{
for (i = 1; i < 4; i++)
{
this["MCbt" + i].reversePlay();
} // end of for
} // End of the function
function overit(num)
{
outit();
this.MCbird.movexy(this.birdXnum[num], this.birdYnum[num]);
this["MCbt" + num].overPlay();
this.prevnum = num;
} // End of the function
MovieClip.prototype.movexy = function (x, y)
{
this.gotoAndStop(1);
this.onEnterFrame = function ()
{
if (Math.abs(this._x - x) < 0.500000 && Math.abs(this._y - y) < 0.500000)
{
this.onEnterFrame = null;
if (this._parent.prevnum <= 1)
{
this.gotoAndStop(2);
}
else
{
this.gotoAndStop(3);
} // end if
}
else
{

把你的图片做成MC,然后放在舞台上。鼠标选中舞台上的这个MC,按F9,然后添加如下代码:
onClipEvent(enterFrame){ //这句意思是,当这个MC被加载时,就触发以下事件。
mouse.hide() //这句是把鼠标原来的指针隐藏,如果不带这句,鼠标指针就还是会出现
startDrag(this,true) //这句是让这个图片MC跟随鼠标移动
}