Click to See Complete Forum and Search --> : Help with an AS3 voting system


cjdsie
08-29-2008, 01:08 PM
Hey I'm new here and I really need some help with a project I'm working on. I created a voting system for subs but once you select the sub you think should be the favorite the result only displays the one you choose. What I need it to do is only display the most clicked on sub. Can anyone help me?

www.subwayvalues.com/bulldogs/

Here is the code so far....
ActionScript Code:
messageBox.text = ""; // Clears the Response box
var correctAnswer:String = "HAM"; // Sets correct answer for comparison
var userAnswer:String; // with value from radio button group.
var rbg:Object = rbNewton.group; // Get the name of the ragio button group from the first button.

btnCheck.addEventListener(MouseEvent.CLICK, checkAnswer);

function checkAnswer(evt:MouseEvent):void {
userAnswer = String(rbg.selectedData);
for(var i:Number = 0; i<30; i++);
if (userAnswer == correctAnswer) {
messageBox.text = userAnswer + i;
gotoAndStop("page2");
// Track with no action
URLLoader("javascript:pageTracker._trackPageview('/folder/file.html');");
}
else {
messageBox.text = userAnswer;
gotoAndStop("page2");
}
trace("working");

}