public function onEnterFrame1(event:Event):void{
ball.y=centerScale+Math.sin(angle)*range;
angle+=speed;
}
7. Heartthrob Formulas 心跳公式
public function onEnterFrame1(event:Event):void{
ball.scaleX=centerScale+Math.sin(angle)*range;
ball.scaleY=centerScale+Math.sin(angle)*range;
angle+=speed;
}
8. Circle Rotation Formulas 公转公式
public function onEnterFrame(event:Event):void{
ball.x=centerX+Math.cos(angle)*radius;
ball.y=centerY+Math.sin(angle)*radius;
angle+=speed;
}
9. Get Circle Area 获取圆周区域
public function getArea():Number{// The formula is Pi times the radius squared.returnMath.PI*Math.pow((width/ 2), 2);
}
10. Get Circumference Ratio 获取圆周长度
public function getCircumference():Number{// The formula is Pi times the diameter.returnMath.PI*width;
}
11. Elliptic Rotation Formulas 椭圆公转
public function onEnterFrame(event:Event):void{
ball.x=centerX+Math.cos(angle)*radiusX;
ball.y=centerY+Math.sin(angle)*radiusY;
angle+=speed;
}
12. Color operations 颜色操作,获取alpha值
var t:uint=0×77ff8877;
var s:uint=0xff000000;
var h:uint=t&s;
var m:uint=h>>24;
trace(m);
13. Hex to Decimal 16进制转10进制
trace(hexValue);
14. Decimal to Hex 10进制转16进制
decimalValue.toString(16);
15. Pick Up Color 颜色拾取
red = color24 >> 16;
green = color24 >> 8 & 0xFF;
blue = color24 & 0xFF;
alpha = color32 >> 24;
red = color32 >> 16 & 0xFF;
green = color32 >> 8 & 0xFF;
blue = color232 & 0xFF;
16. Color Bit Arithmetic 颜色位运算
color24 = red << 16 | green << 8 | blue;
color32 = alpha<< 24 | red << 16 | green << 8 | blue;