求FLASH程序:每次点击小球,小球都能产生沿任意路径的随机运动
答案:1 悬赏:60 手机版
解决时间 2021-03-17 15:27
- 提问者网友:星軌
- 2021-03-16 20:17
求FLASH程序:每次点击小球,小球都能产生沿任意路径的随机运动
最佳答案
- 五星知识达人网友:蓝房子
- 2021-03-16 20:47
AS 2.0:
ball.onpress=function()
{x1=random(10)-5;
y1=random(10)-5;
while(1){
ball._x+=x1;
ball._y+=y1;
}
}
============
AS 3.0
ball.addEventListener(MouseEvent.MOUSE_CLICK,fun);
function fun(e:MouseEvent):void{
x1=random(10)-5;
y1=random(10)-5;
while(1){
ball.x+=x1;
ball.y+=y1;
}
}
ball.onpress=function()
{x1=random(10)-5;
y1=random(10)-5;
while(1){
ball._x+=x1;
ball._y+=y1;
}
}
============
AS 3.0
ball.addEventListener(MouseEvent.MOUSE_CLICK,fun);
function fun(e:MouseEvent):void{
x1=random(10)-5;
y1=random(10)-5;
while(1){
ball.x+=x1;
ball.y+=y1;
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯