View Full Version : Flash contact form
Ducimus
01-26-2008, 05:39 PM
I've been building a drop in contact form for a pair of websites, and have gotten most of the scripting complete (albeit borrowed from other sources) except it will not add in the information for my radio buttons.
I've uploaded the fla and the accompanying php script file to http:www.jestley.com/downloads/contact.rar
If someone has some suggestions or can help me finish the last bit of this form, it would be greatly appreciated.
Chase
BLiZZaRD
01-26-2008, 06:12 PM
I can't download now as I am at work.. but did you create the radio buttons yourself or are they Flash UI radio buttons?
Ducimus
01-26-2008, 11:42 PM
they are just the flash component radio buttons
BLiZZaRD
01-27-2008, 04:46 PM
Radio (and check boxes) in the UI controls is a bit tricky. You can use them for forms and such, and it is expected, but it takes a slight bit of jiggery pokery to get them to send their data out.
So let's say you have 2 radio buttons, one for "yes" and one for "no". Place these instances on your stage and click once on one of them, we will stick with the "yes" for now.
With it selected open the properties panel and select "Parameters" The only 2 parameters you really need to be worried about here are "selected" and "groupName". If you want "yes" selected by default, then change false to true. otherwise leave it false. For the groupName, give it a name, anything you want, this name will affect every radio button with the same name.
With that done, give it an instance name. Let's name it "radio1". Now we can add some action script:
on(click){
_root.radio1 = "YES";
}
Because it is a UI component, when it is clicked it will be selected, no matter what, what we are doing here is telling it that there is a value for the selected, and that value = "YES".
Do the same thing for the "no" radio button, and make sure they have the same groupName, if not then they can both be selected at the same time... that would be bad.
So now you want to get the value on the form to show up on the next frame in an out put window (or where ever), now you just call it...
var radioTxt = "_root.radio1";
Then when the radio button is selected and the movie loads a dynamic text box with a var of "radioTxt" it will show either "YES" or "NO" (or whatever you make them equal too)
If you are coding in AS3, then forget the _root and use the absolute location of the UI component.
Ducimus
01-27-2008, 06:14 PM
So I added this to the actions on the button itself?
Then that being the case, where do i tell it to add this information into the email the php script sends?
Ducimus
01-28-2008, 01:06 AM
Or do I need to put it in the php script?
BLiZZaRD
01-28-2008, 09:45 PM
Umm.. yes. Either or. The codes are designed to go on the radios themselves, or you can do a separate AS file or all in one actions layer with something like:
radio1.onRelease = function() {
this.radio1 = "YES";
}
etc..
the second code set is what reads it, places it in a text field. you can then use your php to pull from that.
Ducimus
01-29-2008, 12:31 AM
Thanks BLiZZaRD, I'll keep poking at it. And I'm sure I'll be back to make this stupid thing work
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.