Flash Database: Giving Action to Submit PollingTag: flash, database, interface Category: PHP Application post: 24 Mar 2008 read: 497
Flash Database Step By Step Tutorial - Part 7: Here, add 2 button. One button for submitting, others to jump to result page. In this post, we talk submit button.
- Still work at second frame. Add two button from user interface components.

- Click on first button (top button). Look at properties. Give name "btn_submit".

- Clic tab parameters. In label, change to "Submit".
- Click Righ again at second frame. Choose actions.
- Add following code to actions panel (below existing codes).
radioGroup.addEventListener("click", foo);
_root.btn_submit.enabled = false;
function foo(eventObj:Object){
if(eventObj.type=="click"){
voteValue = radioGroup.selection.data;
btn_submit.enabled = true;
}
}
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() {
trace('success');
}
}
}
btn_submit.addEventListener("click", mySaveHandler);
|
|
| Give Your Opinion | Recommend
|