PDA

View Full Version : How to go about creating a rating system...


RIT_FlashKid
05-25-2008, 06:24 AM
Hi All,
I've begun creating a rating system but am unsure how to go about the actual storing and recalling of information when the user selects the number of stars. You can see a very stretched out .swf file here (http://bjcmedia.com/starrankingsystem.swf) of what I am trying to do. I am not sure whether I need the as3 to write the data to a text file then pull the data from the same file? Any ideas would be great.
Thanks in advance,
BC

Kuletry
06-06-2008, 02:03 PM
Hi,

You could either store your result in a database or as you say a text file. I would imagine if you dont have a databse/dont want to set one up a text file would be enough. But i may be wrong. The thing you have to remember is to get an average you will need to store three things;

Total: Every time some one adds a new rating, take the current total and add their result to it.

Entries: Every time someone leaves a rating add one to this number.

Then im sure you know to divide Total by the amount of Entries. Then you have your new average. Which you would then also store. So whenever the swf initially loads in it has an average to display. Dont know if thats the best way, but thats what i would do :)

I have a link to a good tutorial on saving to a text file, but unfortunately the site its on seems to be down at the min. As soon as its back up ill post it if you like.

Well i hope that at least vaguely makes sense/answers your Q..

Cheers
LK