• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Using Components > Reading Data from Components

Reading Data from Components

We'll start by creating a series of radio buttons and then figuring out which one the user selected. Go ahead and add this code to what you already have. We're letting the user choose which part of the San Francisco Bay Area they're from (we're assuming all of our users are local).

attachMovie("FRadioButtonSymbol", "radio1", 5); 
attachMovie("FRadioButtonSymbol", "radio2", 6);
attachMovie("FRadioButtonSymbol", "radio3", 7);
attachMovie("FRadioButtonSymbol", "radio4", 8);

radio1._y = 200;
radio2._y = 220;
radio3._y = 240;
radio4._y = 260;

radio1.setLabel("San Francisco");
radio2.setLabel("South Bay");
radio3.setLabel("East Bay");
radio4.setLabel("Marin/North Bay");

radio1.setData("sf");
radio2.setData("south");
radio3.setData("east");
radio4.setData("north");

radio1.setGroupName("surveyGroup");
radio2.setGroupName("surveyGroup");
radio3.setGroupName("surveyGroup");
radio4.setGroupName("surveyGroup");


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint