phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Flash Database: Giving Action to Submit Polling

Tag: flash, database, interface   Category: PHP Application
post: 24 Mar 2008 read: 498


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.
  1. Still work at second frame. Add two button from user interface components.

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

  3. Clic tab parameters. In label, change to "Submit".
  4. Click Righ again at second frame. Choose actions.
  5. 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);
    


Series this article:
Flash Database: Text File
Flash Database: PHP for Reading Data
Flash Database: Saving Data at Server Side
Flash Database: Switching Task at Server Side
Flash Database: Starting Flash
Flash Database: Making Flash Polling Interface
Flash Database: Giving Action to Submit Polling
Flash Database: Trying Submiting Vote
Flash Database: Preparing Polling Result Interface

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting