Flash Database Step By Step Tutorial - Part 8: We have completed polling interface for voting. Next, we talk how to create result of polling.
Before create result page. We finish our second button at vote page.
- Click right on second frame. Choose actions.
- Add code to activate second button. This button for jumping to result page.
btn_view.addEventListener("click", myViewHandler);
function myViewHandler(eventObj:Object){
if(eventObj.type == "click"){
nextFrame();
}
}
- Open stage for second frame. Click on second button. At its property, named "btn_view".
- Click Parameter.
- At Label, write "Result".

Thus, if we click this button, We will jump to next frame or third frame.
- Last, remove trace at mySaveHandler(). Change with nextFrame().
function mySaveHandler(eventObj:Object){
if(eventObj.type=="click"){
totalVotes++;
myVar.allow = 'false';
myVar['votes' + voteValue]++;
radioGroup.enable = false;
btn_submit.enable = false;
var sendVars = new LoadVars();
sendVars.action = 'saveData';
sendVars.num = voteValue;
trace(voteValue)
sendVars.load(file + '?' + sendVars.toString())
sendVars.onLoad = function() {
nextFrame();
}
}
}
This series still continue. I will write next day. Don't miss it!