Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to build and Interactive polling station in Flash?

Posted on 2011-03-11
4
Medium Priority
?
468 Views
Last Modified: 2012-05-11
Hi,

I am trying to develop a simple polling station for an event. The polling station will be driven by a P.C with a touchscreen controller and the output will display a simple bar chart that will update in real-time. I believe this should be quite easy in flash, but I could just do with some pointers.

I have created an rough interface like the attached. There will be 5 buttons for voters to choose. Each voter can only select one button. When they make their selection I need three things to happen :

1) I need the values to be shown as a percentage of the total number of votes. (i.e: if only 2 people vote each would display 50%. If 4 voted it would calculate the total of each to be 25%)
2) I need the values to create a simple bar chart of the figures.
3) Add their vote to the total number of votes.

Any pointers would really help as I am primarily a designer with very basic flash or programming knowledge.

Many thanks,


 Interface mock up
0
Comment
Question by:ajstokes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:quizengine
ID: 35116362
see the example app I've uploaded. Check layer 1 frame 1 for the initialisation of the variables and the function that updates the graph. (select the frame and see the actions panel - F9 if the actions panel isn't showing)

Click one of the voting buttons and again see the actions panel to see the code.
voting-app-cs3.fla
0
 

Author Comment

by:ajstokes
ID: 35118894
Hi quizengine,

Thank you so much for your reply and the sample code (with comments!) This is a great starting point for me to try and figure this out.

The code works as expected although by the time I get to say 60+ votes the graph is really small. I understand this is because each part together makes up the full 300px height but I wonder, is there a way to scale the vertical axis of the chart so that it would utilize the full space?

The other thing I need to figure out is a) How to display the total number of votes (i.e : the total number of clicks from all buttons) and more importantly b) how to display the figure above each column as a % of the total number of votes taken.

I will keep searching, but if you had any other tips would be great.

Many thanks again!
0
 
LVL 19

Accepted Solution

by:
quizengine earned 2000 total points
ID: 35121190
New version attached
voting-app-v2-cs3.fla
0
 

Author Comment

by:ajstokes
ID: 35124731
quizengine you are amazing and I am very grateful for your help! The code works great!

If anyone else is reading this would they care to comment? quizengine, you have helped more than enough, I am just experimenting with the code to add more features :

1) A way to alter the opacity of the columns, so the leading column is 100% opacity through to the lowest being 25% opacity. This would help the results stand out.

2) I have just discovered that there will be approx 200 people at this event. How easy is it to modify the code so that each vote click advances the column +1 increment (total height of each column would be ~200) rather than scaling each block to a % all clicks on each click? I'd still like to display the % of total, but I think visually it may work better than having every block scale after every click.

3) Is it possible to attach the number of votes for each column near the top of each column. This would mean the text would move as each column was voted.

quizengine, many many thanks again for your solutions. If anyone else would care to comment, it would be most appreciated! Thank you experts!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question