dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: dividing lines

  1. #1
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003
    Location
    Here
    Posts
    779

    dividing lines

    hey there.
    ill be quick... thanks for reading.

    assume I have a bar that counts a percentage for a voting graph, fing... yeah.

    ill explain what i mean with this example. assume 4 people have voted on a particular poll, "which is better, apple or banana?". 3 people vote apple, and 1 person votes banana. its easy to have 25%/75% displayed. but can I make dividing lines displaying how many votes there are?

    im not expecting anything more than 15-25 votes, so this isnt large scale.

    check my example out to see what i want as a result.
    (the first example is the one i explained above, the second is the same but with 3 times as many voters)

    thanks
    thewaste
    "Good lord, you're wasting thousands of dollars worth of Interferon!"
    "... and you're Interferon with our good time!"

  2. #2
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003
    Location
    Here
    Posts
    779
    PS -
    this seems like it would be done with the drawline function. im not sure how it works tho :S
    "Good lord, you're wasting thousands of dollars worth of Interferon!"
    "... and you're Interferon with our good time!"

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I'd do it with differently colored attached movie clips, number according to votes casted. Maybe a little tricky to scale them if you want the overall bar size to allways be the same, but I guess it could be done by scaling the attached movie clips accordingly, when "drawing" up the graph.

  4. #4
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003
    Location
    Here
    Posts
    779
    I want the value to be varible. to be honest, i want it to retrieve a number from online. that many movieclips is sure to slow the movie... isnt it?
    "Good lord, you're wasting thousands of dollars worth of Interferon!"
    "... and you're Interferon with our good time!"

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    25 votes? Nah! No apparent slowdown!
    Won't be slower that drawing the damn things!

  6. #6
    FK Romeo martiansam's Avatar
    Join Date
    Oct 2001
    Location
    Bombay, India
    Posts
    223
    Assuming that you are already getting the Red bar and the Blue bar properly according to the number of votes...

    I would have taken a symbol consisting of a vertical line and duplicated it by (number of votes - 1) times and placed at an equal distance of (red bar width + blue bar width) divided by (total number of votes) on the bars.

    I think that wold be easy rather than duplicating the red and blue bars themselves and also worrying about the fixed width for the total result.
    sameer rao

    there...you see!!

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    However they do it on Mars!

    Still duplicating, and actually Flash is duplicating for you!
    What if I had 4 items in the poll?
    What if I wanted random colors on all items each time the poll was refreshed?
    What if I just shut up, and go to bed!
    Last edited by oldnewbie; 02-17-2004 at 03:16 AM.

  8. #8
    FK Romeo martiansam's Avatar
    Join Date
    Oct 2001
    Location
    Bombay, India
    Posts
    223
    The original question was just regarding putting dividing lines on already created bars (2 colors, 4 colors, n number of colors).

    My formula is generalised. and should work...no matter what.

    Consultant on planet earth!!! GOOD NIGHT.
    sameer rao

    there...you see!!

  9. #9
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003
    Location
    Here
    Posts
    779
    rest assured. only two colors.
    thanks for the help everyone...
    cyas.
    "Good lord, you're wasting thousands of dollars worth of Interferon!"
    "... and you're Interferon with our good time!"

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