all groups > flash actionscript > september 2007 >
You're in the

flash actionscript

group:

RadioButton Help


RadioButton Help tom38
9/30/2007 12:00:00 AM
flash actionscript:
Hey,

I m having issues with radioButtons , due to the fact that I m unsure how they
work!
I hope someone has the time and energy to help me, appreciate it a lot.

Oki here is the deal.

I want to have 3 radioButtons so they become a scale from 1 - 3, meaning there
will be a question and they will answer on a scale from 1 - 3.

So all the radioButtons belong to the same groupName = radioButton.

Now what I need to do is to make sure that the button that was marked will be
posted.
So if I gave each of the radioButtons and instance name , lets say g1, g2, g3:
i would need to type in my script the following:

my_vars.g1 = g1.radioButton ?

my_vars.g2 = g2.radioButton ?

my_vars.g3 = g3.radioButton ?

But how do I know which one the user marked? I only want to send through php,
the marked button!

Should I do an If condition?

Hopefully someone can guide me through this!

Best Regards

Tom

stop();
System.useCodepage = true;
send_btn.onRelease = function() {
my_vars = new LoadVars();


my_vars.fnamn = fnamn_box.text
my_vars.enamn = enamn_box.text;
my_vars.tele = tele_box.text;
my_vars.mobil = mobil_box.text;
my_vars.sender = email_box.text;
my_vars.message = message_box.text;




if (my_vars.sender != "" and my_vars.fnamn != "" and my_vars.enamn != "" and
my_vars.tele != "" and my_vars.mobil != "" and my_vars.message != "") {
my_vars.sendAndLoad("mailer.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
email_box.onSetFocus = fnamn_box.onSetFocus = enamn_box.onSetFocus =
tele_box.onSetFocus = mobil_box.onSetFocus = message_box.onSetFocus=function ()
{
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};
Re: RadioButton Help nice dice
9/30/2007 12:00:00 AM
Hi tom,
Having a similar problem with radio buttons - if your wanting to post the data
from the result of your 3 radio buttons to php then as long as the 'answer'
appears in a dynamic text box then can't you set the php script to pick up the
answer like in a contact form?
Im not very good at this sort of stuff but I'll try to post a fla and php to
show you roughly how I've got around the problem.
Cheers
Duncan
Re: RadioButton Help nice dice
9/30/2007 12:00:00 AM
Re: RadioButton Help tom38
10/1/2007 12:00:00 AM
Hi again,

I m not sure you received my message. But I m not able to open your fla. I can
download it but it says "unexpected file".
Regarding the php. I cant even download it hehe, typical .

THe swf file works though!

Appreciate the help !

Best Regard
Tom
Re: RadioButton Help tom38
10/6/2007 2:39:39 PM
Oki Guys I managed to solve the problem with the radio buttons on my own.

To receive a value from your radio button:

my_vars.radioButton = Group2.getValue(); //Group2 is the group name i use for
the radio button. getValue() //returns the value if marked.

So if you have five radio buttons placed:
1. make sure you name them all with the same group Name through the parameters
window.
2. then just type the code getValue() and barabim barabum....get down james
brown!

Of course you need to place a radion button from the component section that
follows along with flash!




Re: RadioButton Help tom38
10/7/2007 4:17:19 PM
Yep its me once again!

Stuck on another problem that I cant find on the webb. tabIndex is a way to
index the forms in flash. But i dont seem to be able to tab through to my
radioButtons :)!

Any suggestions?

Best Regards

T
AddThis Social Bookmark Button