Solved

Flash form radio buttons - Set variable on selection

Posted on 2007-12-04
3
1,721 Views
Last Modified: 2010-04-21
Hello,

I'm trying to do something that seems somewhat simple on the surface but I've yet to come up with a solution:

I have 3 radio buttons within an embedded swf with the following parameters:

button1
data: blue
groupName: Colors

button2
data: red
groupName: Colors

button3
data: yellow
groupName: Colors

When button2 is selected, I need the global variable, _global.theColor, set to "red".

Any direction is greatly appreciated.

thanks
0
Comment
Question by:wattanabi2
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
FathomX earned 250 total points
ID: 20404480
i just recreated what i think you're trying to do.
first I made the buttons and named the three button1, button2, button3. Then on the FRAME i put this code.

_global.theColor = "black";
trace (_global.theColor);


Then I selected button1 and put this AS on it:

on(click){
      _global.theColor = "blue";
      trace (_global.theColor);
}



then on button2 this AS:

on(click){
      _global.theColor = "blue";
      trace (_global.theColor);
}


finally on button3 this AS:

on(click){
      _global.theColor = "blue";
      trace (_global.theColor);
}



Once you test the movie and click on one of the buttons you'll notice the output window will trace the _global.theColor var
0
 

Author Closing Comment

by:wattanabi2
ID: 31412606
Worked like a charm. Thanks!
0
 
LVL 1

Expert Comment

by:FathomX
ID: 20404541
i'm sorry, on button2 i put:
on(click){
      _global.theColor = "red";
      trace (_global.theColor);
}

on button3 i put:
on(click){
      _global.theColor = "yellow";
      trace (_global.theColor);
}
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Youtube video error 30 810
Crash with shockwave flash 8 252
bandwidth 5 76
Windows 7, Adobe Flash Player and Internet Explorer 11 15 103
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

828 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