Solved

How to build and Interactive polling station in Flash?

Posted on 2011-03-11
4
452 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

734 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