[Flashcoders] trying to get data from list component
I have a list component (multiple selection) on the stage. I am trying to send the selections from the list to sql database via php. I'm using the script below to convert the data selected from the list to a string. The trace works as designed. What do I send in my variables to php script? topskillsfield.selectedIndices is not working. topskillsfield is my list item. Any help would be greatly appreciated. submitTwoBtn.addEventListener(MouseEvent.CLICK, submitHandler); function submitHandler(e:MouseEvent) { var myArr:Array = topskillsfield.selectedIndices; var selectedTopSkills:String = ; for(var i:int = 0; i myArr.length; i++) { var j:int = myArr[i]; if(selectedTopSkills == ) { selectedTopSkills = topskillsfield.getItemAt(j).data; } else { selectedTopSkills += , + topskillsfield.getItemAt(j).data; } } trace(selectedTopSkills: + selectedTopSkills); } DON TALCOTT 316 Greenwood Avenue Decatur, Georgia 30030 404.538.1642 dtalc...@mindspring.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] trying to get data from list component
.selectedIndex ?? On May 26, 2011, at 2:36 PM, DONALD TALCOTT wrote: .selectedIndices Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] trying to get data from list component
Check out this page to get a handle... http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLVariables.html -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of DONALD TALCOTT Sent: Thursday, May 26, 2011 3:37 PM To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] trying to get data from list component I have a list component (multiple selection) on the stage. I am trying to send the selections from the list to sql database via php. I'm using the script below to convert the data selected from the list to a string. The trace works as designed. What do I send in my variables to php script? topskillsfield.selectedIndices is not working. topskillsfield is my list item. Any help would be greatly appreciated. submitTwoBtn.addEventListener(MouseEvent.CLICK, submitHandler); function submitHandler(e:MouseEvent) { var myArr:Array = topskillsfield.selectedIndices; var selectedTopSkills:String = ; for(var i:int = 0; i myArr.length; i++) { var j:int = myArr[i]; if(selectedTopSkills == ) { selectedTopSkills = topskillsfield.getItemAt(j).data; } else { selectedTopSkills += , + topskillsfield.getItemAt(j).data; } } trace(selectedTopSkills: + selectedTopSkills); } DON TALCOTT 316 Greenwood Avenue Decatur, Georgia 30030 404.538.1642 dtalc...@mindspring.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] trying to get data from list component
function submitHandler(e:MouseEvent) { var myArr:Array = topskillsfield.selectedIndices; var selectedTopSkills:String = ; for(var i:int = 0; i myArr.length; i++) { var j:int = myArr[i]; if(selectedTopSkills == ) { selectedTopSkills = topskillsfield.getItemAt(j).data; } else { selectedTopSkills += , + topskillsfield.getItemAt(j).data; } } trace(selectedTopSkills: + selectedTopSkills); } my trace ouputs the following: selectedTopSkills: Written Communication, Networking, Public Speaking, Negotiation, Strategic Planning When I use the following in my variables, the number of selections (5) is posted to db. I need to post Written Communication, Networking, Public Speaking, Negotiation, Strategic Planning to the db. var variables:URLVariables = new URLVariables(); variables.firstname = fnamefield.text; variables.lastname = lnamefield.text; variables.title = titlefield.text; variables.dept = deptfield.value; variables.email = emailfield.text; variables.nickname = mc_one.nicknamefield.text; variables.birthday = mc_one.birthdayfield.text; variables.anniversary = mc_one.anniversaryfield.text; variables.topskills = mc_two.topskillsfield.selectedIndices; variables.rightlefthanded = mc_three.radioGroup1.selection.value; variables.hometown = mc_four.hometownfield.text; variables.college = mc_four.collegefield.text; variables.achievement1 = mc_five.achievement1field.text; variables.achievement2 = mc_five.achievement2field.text; variables.photo = mc_six.photo.fileDisplay_txt.text; On May 26, 2011, at 3:41 PM, Karl DeSaulniers wrote: .selectedIndex ?? On May 26, 2011, at 2:36 PM, DONALD TALCOTT wrote: .selectedIndices Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders DON TALCOTT 316 Greenwood Avenue Decatur, Georgia 30030 404.538.1642 dtalc...@mindspring.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] trying to get data from list component
Try this... On May 26, 2011, at 3:27 PM, DONALD TALCOTT wrote: function submitHandler(e:MouseEvent) { var myArr:Array = topskillsfield.selectedIndices; var selectedTopSkills:String = ; for(var i:int = 0; i myArr.length; i++) { var j:int = myArr[i]; if(selectedTopSkills == ) { selectedTopSkills = topskillsfield.getItemAt(j).data; } else { selectedTopSkills += , + topskillsfield.getItemAt (j).data; } } return selectedTopSkills; //trace(selectedTopSkills: + selectedTopSkills); } my trace ouputs the following: selectedTopSkills: Written Communication, Networking, Public Speaking, Negotiation, Strategic Planning When I use the following in my variables, the number of selections (5) is posted to db. I need to post Written Communication, Networking, Public Speaking, Negotiation, Strategic Planning to the db. var variables:URLVariables = new URLVariables(); variables.firstname = fnamefield.text; variables.lastname = lnamefield.text; variables.title = titlefield.text; variables.dept = deptfield.value; variables.email = emailfield.text; variables.nickname = mc_one.nicknamefield.text; variables.birthday = mc_one.birthdayfield.text; variables.anniversary = mc_one.anniversaryfield.text; //variables.topskills = mc_two.topskillsfield.selectedIndices; variables.topskills = selectedTopSkills; // Must be set after above function is called. variables.rightlefthanded = mc_three.radioGroup1.selection.value; variables.hometown = mc_four.hometownfield.text; variables.college = mc_four.collegefield.text; variables.achievement1 = mc_five.achievement1field.text; variables.achievement2 = mc_five.achievement2field.text; variables.photo = mc_six.photo.fileDisplay_txt.text; HTH, Best, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders