Solved

Flash form radio buttons - Set variable on selection

Posted on 2007-12-04
3
1,723 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

617 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