This is a discussion on "flash combox 2 PHP" within the Flash & Multimedia Forum section. This forum, and the thread "flash combox 2 PHP are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
flash combox 2 PHP
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
flash combox 2 PHP
Hi flash community,
Just and example on how to receive flash form input (standard time 3:25 PM) to military time (15:25) Also this example shows how to get flash combox values 2 php!!! First, create three combox components on stage/form (One for hr,min, then AM/PM) Second,give combox instance names (Hr_cb,Min_cb,AMPM_cb) example: create layer called "actions". Inside there do this... stop(); //initialize form when load //if you have php script and code "phpscript()" you will see posted variables //even though there null Hour_cb = ""; Min_cb = ""; AM_PM_cb = "" //establish component listener for comboboxes cb_comp_listner1 = new Object(); cb_comp_listner1 = function(evt){ trace("Selected data is: " + evt.target.selectedItem.label); } Hr_cb.addEventListener("change", cb_comp_listner1); cb_comp_listner2 = new Object(); cb_comp_listner2 = function(evt){ trace("Selected data is: " + evt.target.selectedItem.label); } Min_cb.addEventListener("change", cb_comp_listner1); cb_comp_listner3 = new Object(); cb_comp_listner3 = function(evt){ trace("Selected data is: " + evt.target.selectedItem.label); } AMPM_cb.addEventListener("change", cb_comp_listner1); //button to submit info to php script Apply_Button.onRelease = function () { //of course apply validations for other components if neccessary here //store selected option from combox to variables Hour_cb = Hr_cb.getValue(); Min_cb = Min_cb.getValue(); AM_PM_cb = AMPM_cb.getValue(); //below...either one works...only do one of them, delete the one // set sumbitURL to the URL of server side script insertURL = "http://localhost/insertTable.php"; //this (if this input your url in "insertURL"where php script is located on srver loadVariablesNum(insertURL, replyData, "POST"); //or this getURL("http:\\\\localhost\\insertTable.php", "_blank", "POST"); } PHP script do this to convert standard time to military and get combo box values... <?php if($_POST['AM_PM_cb] == "AM" AND $_POST['Hour_cb'] < 12){ $AThr = $_POST['A_Time_On_Hr']; $ATmin = $_POST['A_Time_On_Min']; $A_T_On = $AThr . $ATmin; }else if($_POST['AM_PM_cb'] == "AM" AND $_POST['Hour_cb'] == 12){ $AThr = $_POST['A_Time_On_Hr'] - 12; $ATmin = $_POST['A_Time_On_Min']; $A_T_On = $AThr . $ATmin; }else if($_POST['AM_PM_cb'] == "PM" AND $_POST['Hour_cb'] < 12){ $AThr = $_POST['A_Time_On_Hr'] + 12; $ATmin = $_POST['A_Time_On_Min']; $A_T_On = $AThr . $ATmin; }else if($_POST['AM_PM_cb'] == "PM" AND $_POST['Hour_cb'] == 12){ $AThr = $_POST['A_Time_On_Hr']; $ATmin = $_POST['A_Time_On_Min']; $A_T_On = $AThr . $ATmin; } //output to screen to debug results echo "$A_T_On"; ?> THATS IT!!!!! |
|
|
![]() |
| Tags |
| combobox 2 php |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sr. Flash Developer > SynCruiser Flash Widget | ipanema | Job Opportunities | 0 | Apr 10th, 2008 23:20 |
| Flash Designer (Central London, Flash, Flash Games, Flash banners, 22K-28K) | CapitalStrategy | Job Opportunities | 0 | Aug 13th, 2007 09:39 |
| Flash Designer (Central London, Flash, Flash Games, Flash banners, 22K-28K) | CapitalStrategy | Job Opportunities | 0 | Aug 13th, 2007 09:04 |
| playing flash within flash with slow internet connection | bejamshi | Flash & Multimedia Forum | 4 | Jan 19th, 2007 02:07 |
| Cannot see some Flash after upgrading to Flash Player 9 | ralloux | Flash & Multimedia Forum | 2 | Aug 30th, 2006 21:48 |