A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: expert trig question

Threaded View

  1. #1
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472

    expert trig question

    Hi All,

    First - see the attached file!

    Based on 10 values i need to draw a polygon.
    In the code below I am able to draw a polygon but i need to dynamicly use the values in the array 'arrValues'

    PHP Code:
    ArrValues=[1,10,7,4,9,1,8,2,6,4];
    point 0;
    noOfPoints 10;
    steps = (2*Math.PI)/noOfPoints;

    _root.createEmptyMovieClip ("polygon"1);
      
    with (_root.polygon){
        
    beginFill (0x0000FF50);
        
    lineStyle (50xFF00FF100);
        
    moveTo (100*Math.cos(point), 100*Math.sin(point));
        for (
    i=0i<noOfPointsi++) {
            
    point += steps;
            
    pointX 100*Math.cos(point);
            
    pointY 100*Math.sin(point);
            
    lineTo (pointXpointY);
        }
        
    endFill();

    Any help is rewarded with good good karma
    //podenphant
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center