Determine flash radio button selected

Posted on 2007-10-10
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

    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

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    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…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now