A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Flash chart help

  1. #1
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121

    Flash chart help

    I client asked me for a chart in flash, I have some ideas, but I want to know if anyone here has made something similar

    I just have some values that the user will put, so I take those values and create dots in the chart, so that part is easy I also can do more details but how can I make a union between dots with a line, I want a line touching every dot to make the chart work

    Any ideas?

    (again a questions that seems has to be outside games, but I like this section, lol )


    "I love to make them as I love to play them"

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Maybe you could draw a picture. Dont think I understand you atm, as drawing line between dots is not really difficult.

  3. #3

  4. #4
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    hey scheletro, aren't we just talking :
    Code:
    mc.moveTo(firstPointX, firstPointY)
    mc.lineTo(secondPointX, secondPointY)
    mc.lineTo(thirdPointX, thirdPointY)
    etc...
    (in AS 3 it's mc.graphics.lineTo and moveTo)
    Streets Of Poker - Heads-Up Texas Hold'em Poker Game

  5. #5
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    Maybe you could draw a picture. Dont think I understand you atm, as drawing line between dots is not really difficult.
    I can imagine that, although Ive made more than 80 games Im bad programmer so I always try to get answer from my limited knowledge, youll see why below

    Thanks for that, yeap, that was the only thing I found searching on the forums, but the thing is Im no leading variables from a DB, the user is going to put values, so I needed something simple

    hey scheletro, aren't we just talking :
    Code:

    mc.moveTo(firstPointX, firstPointY) mc.lineTo(secondPointX, secondPointY) mc.lineTo(thirdPointX, thirdPointY) etc...


    (in AS 3 it's mc.graphics.lineTo and moveTo)
    Thanks but Im still using AS2, but Ill remember this

    Well, I saw this comments today that I already have a demo running, what I did is to use an script that found in one of my games

    [CODE]bug_mc.onEnterFrame = function() {
    var dx = _root.chart.punto2._x-this._x;
    var dy = _root.chart.punto2._y-this._y;
    var angle = Math.atan2(dy, dx);
    this._rotation = angle*180/Math.PI;
    };


    "I love to make them as I love to play them"

  6. #6
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    (this thing doesnt let me put long posts, so I need to write a new one)

    Yeap, that script is to follow a target, but that was the best solution for my problem at that time, so I made the line to position in the _y of one point and follow the next

    I know a good programmer has a simple solution, if you have one is welcome

    I also planning to upload the source to help somebody with the same problem at least till one good solution is mentioned

    Here is the demo

    I hope to see solutions and comments on that demo


    "I love to make them as I love to play them"

  7. #7
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    scheletro, for that, you just need the code I posted! No need for trig on that one! But since it works for you, and it looks good, I guess there's no need to change it

    Good job, it really looks nice and clean!
    Streets Of Poker - Heads-Up Texas Hold'em Poker Game

  8. #8
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    Quote Originally Posted by phreax
    scheletro, for that, you just need the code I posted! No need for trig on that one! But since it works for you, and it looks good, I guess there's no need to change it

    Good job, it really looks nice and clean!
    I was thinking that your code was for AS3 and Im using AS2, can I use your code then?


    "I love to make them as I love to play them"

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by scheletro
    I was thinking that your code was for AS3 and Im using AS2, can I use your code then?
    Yes you can, graphics class and its methods like moveTo, lineTo and beginFill were added in FlashMX(6).

  10. #10
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    thaaaaanks !!


    "I love to make them as I love to play them"

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