A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to Plot a Line with the help of Flash Action Script

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    4
    I need to know how can i draw a line using flash Action Script with the help of X,Y Cordinates.. for example... I want to draw a line from Point (1) x-10, y-400 till Point (2) x-250, y-150

    Now I am planning to get thease cordinates (X,y) from databse and generate a graph with the help of scripting.

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    106

    here i am

    hi,

    just place the code in the frame actions and check

    //------code starts here---------
    x=10
    y=400
    //------------parameters->stroke width,color,alpha
    _root.lineStyle(1,0xff0000,100)
    _root.moveTo(x,y)
    x=250
    y=150
    _root.lineTo(x,y)

    //-----code ends here-------------

    you can draw curves you can also fill the drawing
    all that you got to do is use
    //------------parameters->color,alpha
    _root.beginFill(0x00ff00,100)

    just place the above code before the first code and check that also

    you can fill gradient colors also and draw circle and fill them with the gradient colors as well.....may be useful for piecharts..

    but best is to use the components which are existing from Macromedia Exchange for Graphs.....


    Cheeeeeeers
    gnana

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