A Flash Developer Resource Site

1. ## 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

2. PS -
this seems like it would be done with the drawline function. im not sure how it works tho :S

3. 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. 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?

5. 25 votes? Nah! No apparent slowdown!
Won't be slower that drawing the damn things!

6. 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.

7. 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!

8. 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.

9. rest assured. only two colors.
thanks for the help everyone...
cyas.

#### Posting Permissions

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

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap