Notice
Recent Posts
Recent Comments
SNOWFLAKES DRAWING PAPER
[AS3] anglePositionRet :: 원형 위치 값 구하기 본문
MXML
... import fzOo.ssr.ReturnValue; private function init():void { var arrPosition:Array=[]; for (var i:int=0; i<360; i++) { arrPosition.push( ReturnValue.anglePositionRet(cv.width/2,i) ); } var len:int = arrPosition.length; trace(len); for (i=0; i<len; i++) { trace(arrPosition[i].x,arrPosition[i].y); cv.graphics.beginFill(0x000000,1); cv.graphics.drawCircle( arrPosition[i].x,arrPosition[i].y,1 ); cv.graphics.endFill(); } } ... <mx:Canvas id="cv" width="100" height="100" x="{(this.width-cv.width)/2}" y="{(this.height-cv.height)/2}" backgroundColor="#FFFFFF" backgroundAlpha="0.2"/> ... |
anglePositionRet()
public static function anglePositionRet(radius:Number, angle:int):Object { with (Math){ var radianAngle:Number=angle*PI/180; var mX:Number =( cos(radianAngle).toFixed(3) ) * radius; var mY:Number =( sin(radianAngle).toFixed(3) ) * radius; } var retObj:Object = new Object(); retObj.x = mX + radius; retObj.y = mY + radius; return retObj; } |
'개발 > FLEX/AS3/AIR/BlazeDS' 카테고리의 다른 글
[AS] 문자열 더하기 방법 성능비교! (0) | 2008.11.01 |
---|---|
[FLEX] Flex Application 시작시 발생 이벤트 순서 (0) | 2008.10.19 |
[AS3] Essential ActionScript 3.0 (PDF) (0) | 2008.10.08 |
Interface 란 무엇일까 ? (0) | 2008.10.08 |
[FLEX] Datagrid 마우스오버한 Row 인덱스값 찾기 (0) | 2008.10.07 |
Comments