AS3.0在函数外怎样同时得到a1,a2,b1,b2参数
package{
importflash.display.MovieClip;
importflash.display.Sprite;
importflash.geom.Point;
importflash.events.MouseEvent;
importflash.events.DataEvent;
importflash.utils.Timer;
publicclassTrowballextendsMovieClip{
privatevarp1:Point;
privatevarp2:Point;
privatevarv1:Number;
privatevarv2:Number;
publicfunctionTrowball(){
varball=newBALL();
addChild(ball);
ball.x=stage.stageHeight/2;
ball.y=stage.stageWidth/2;
functiondown(evt:MouseEvent):void{
evt.target.startDrag();
p1=newPoint(mouseX,mouseY);
//p1.x=mouseX;
//p1.y=mouseY;
vardate:Date=newDate();
vara1:Number=date.seconds;
varb1:Number=date.milliseconds;
trace();
trace("移动前坐标"+p1);
trace("鼠标移动秒数"+a1);
trace("鼠标移动毫秒数"+b1);
}
functionup(evt:MouseEvent):void{
evt.target.stopDrag();
p2=newPoint(mouseX,mouseY);
vardate:Date=newDate();
vara2:Number=date.seconds;;
varb2:Number=date.milliseconds;
trace("移动后坐标"+p2);
trace("鼠标移动秒数"+a2);
trace("鼠标移动毫秒数"+b2);
}
ball.addEventListener(MouseEvent.MOUSE_DOWN,down);
ball.addEventListener(MouseEvent.MOUSE_UP,up);
}
}
}