Determine flash radio button selected

Posted on 2007-10-10
Medium Priority
Last Modified: 2010-05-18
have a flash movie clip that has a button group consisting of three buttons. I have a regulat "submit" button right below the radio group that when it is clicked I want to go to a particular frame of the movie clip. For example, if radio button one is selected and then I clicked the "submit" button I would gotostop(10). If the next button of the group selected and the "submit" button clicked I would gotoandstop(11) and so on.

Does anyone have any sample actionscript that I could insert into the "submit" button listener?

Thanks in advance
Question by:wfrenck
1 Comment
LVL 18

Accepted Solution

Antonio Estrada earned 2000 total points
ID: 20051221
First you need to lookup if they're all on the same Group, and the name of it, so click on any of the radio buttons and then open the component inspector (Alt+F7), you should see the property groupName which is what we're going to use. The default is "radioGroup" and we're going to keep it that way for now.

Let's say that you have 3 radios (Radio1, Radio2 and Radio3), you'll have to select them one by one and add an instance name (on the properties panel), call them R1, R2 and R3 for now.

Add a button and add this code to it:

on(release) {
      if(_parent.radioGroup.selection==_parent.R1) _parent.gotoAndStop(10);
      if(_parent.radioGroup.selection==_parent.R2) _parent.gotoAndStop(11);
      if(_parent.radioGroup.selection==_parent.R3) _parent.gotoAndStop(12);

That should do the trick.

Good Luck.


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question