FORUMS: list search recent posts

AS3 Poll: Number change when user clicks

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jessica Chapman
AS3 Poll: Number change when user clicks
on Nov 14, 2010 at 11:00:29 am

Hi there,

I was wondering if anyone knew of an AS3 code, or any examples, that could help me out in achieving this...


I have a poll design (only a mock-up, I don't need it to actually record votes), with a number of multiple boxes to select. Upon the first click of a box, I want the box to have the number 1 appear in it. When the next box is clicked, the number 2, and so on.


If a box that already has a number entered in it, is double clicked, I want the number to go away, so that the user can re-use that number in another box.



Because this is a poll, I would also like to know if there is a script I could use that could tell if a certain number of boxes had been selected or not.

For example, if 5 boxes are not selected, and the user presses the submit button, the user will be taken to another section which will tell them that they did not fill out the poll correctly. If they did fill out the poll correctly, it would take them to another section, saying that the vote was successful.



Is this going to be really difficult to get to work? I am a bit of a n00b when it comes to coding, but if there are examples I could learn from, I would really like to give it a go. :)


I would be very grateful for any advice! :)

Jess


Return to posts index

Marcus Geduld
Re: AS3 Poll: Number change when user clicks
on Nov 28, 2010 at 8:58:30 pm

I don't really understand what you're trying to create. Here's what it sounds like, from your description: when you first see the app, it looks like this, a series of empty boxes:

[]
[]
[]
[]
[]

If the user clicks one, it gets a number one in it:

[]
[1] -- user just clicked here
[]
[]
[]

If the user clicks another one, it gets a number two in it:

[]
[1]
[]
[2] -- user just clicked here
[]

If the user re-clicks the first box he clicked, the number in it vanishes:

[]
[] -- user just clicked here again
[]
[2]
[]

What happens to the [2]? does it stay a [2] or does it become a [1]?

What happens if the current state is this?

[1]
[2]
[3]
[4]
[5]

And the user clicks the [4] again...

[1]
[2]
[3]
[]
[5]

... and then clicks it AGAIN? Do we get this?

[1]
[6]
[3]
[4]
[5]

Also, please note that Flash apps running on the web can't save information. In other words, if fifty people take the poll, Flash won't remember or save how they all voted. In order to do that, you need a database on the server and some kind of scripting language, such as PHP or .NET.

Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]