|
查看: 1790|回复: 4
|
怎样在mouseover 时让object 停下來?
[复制链接]
|
|
|
发表于 21-11-2008 09:39 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
有些难题想請你們帮帮忙, 我在弄一个object"点狀的", 然后用下面的script 給它绕著中心点自己转圆圈, 就像wheel酱, 一个圆圈上面會有很多点,
可是我想把它, 当mouseover到那object时可以給它自己停下來, cursor移開后又継续转? 要怎样办啊? 还是有其它的方法呢? 謝啦~ ^^
onClipEvent (load)
{
radius = 40;
degrees = 0;
}
onClipEvent (enterFrame)
{
angle = degrees * 0.017453;
degrees = degrees + 1;
xposition = radius * Math.cos(angle);
yposition = radius * Math.sin(angle);
this._x = xposition + _root.center_cross._x;
this._y = yposition + _root.center_cross._y;
}
on (release){
_root.bg_color.gotoAndPlay("red");
_root.gotoAndPlay("msg");
} |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-11-2008 01:13 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 25-11-2008 02:59 AM
|
显示全部楼层
hm..也不是沒爬帖啦, 就是看不明白, 又不懂怎样弄, 所以才要再問咯, 不好意思啦...
結果到现在还是不成功... -.-''' |
|
|
|
|
|
|
|
|
|
|
发表于 25-11-2008 06:30 AM
|
显示全部楼层
稍微改了你的Code。你先给你那个"object"(点状的)一个instance name叫做dotted把下面的Code放进第一个Frame的AS里就可以了。记得把你MovieClip里面的AS全部删除。
onLoad=function(){
radius = 40;
degrees = 0;
}
dotted.onEnterFrame=function(){
if(this.hitTest(_xmouse,_ymouse)==false){
angle = degrees*0.017453;
degrees = degrees+1;
xposition = radius*Math.cos(angle);
yposition = radius*Math.sin(angle);
this._x = xposition+_root.center_cross._x;
this._y = yposition+_root.center_cross._y;
}
}
其实有更容易的方法代替圆圈运动。。。
有个Code叫做 _rotation。你可以去Flash的Help里面查,里面有Example~ |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|