View Full Version : radio button question!
usr radioshack
12-06-2002, 02:10 AM
im pretty new at programming, and flash itself..
i want to have radio buttons at the opening page of my site..
one is labeled Sound and the other will be No Sound.
when you click enter, i want it to go to the corresponding radio button... can anyone help me get started? i am unsure of what to do after trying several things.. i am using flash MX
thanks!
red penguin
12-06-2002, 04:03 AM
1. Open Flash MX
2. Make sure you have the Components Panel open. [ Window --> Components ]
3. Drag two radio buttons to the stage
4. Make sure you have the Properties Panel open. [ Window --> Properties ]
5. Select one on the stage.
6. Label it in the Properties "Sound On" and give it an instance name like btn_on.
7. Label the other one "Sound Off" and give it a name like btn_off.
8. Make the initial state of one of them true.
9. Make sure they have the same Group Name
10. Make your ENTER button and on that button use the script:
on (release) {
if (_root.btn_on.selected) {
trace("sound will be on");
} else {
trace("sound will be off");
}
}
usr radioshack
12-06-2002, 06:35 AM
thanks red penguin.. im almost there...
if sound is selected i need to send it to a different scene.
and the same if no sound is selected....
im just splitting the two pages so the user has a choice....
do you see what im saying?
thanks for the code though.. it is still useful to me.. i save all of the advice i get.. can you help me more?
or anyone for that matter?
thanks!
binkyboo
12-06-2002, 12:24 PM
Couldn't you specify that in red's code?
on (release) {
if (_root.btn_on.selected) {
trace("sound will be on");
gotoAndPlay("Scene_1", 1);
} else {
trace("sound will be off");
gotoAndPlay("Scene_2", 1);
}
}
red penguin
12-06-2002, 03:36 PM
Exactly...
Just specify where in the movie you want it to go!
usr radioshack
12-06-2002, 04:18 PM
i tried that last night.. it didnt work... ill try it again just to double check though.....
usr radioshack
12-06-2002, 04:39 PM
on (release) {
if (_root.btn_on.selected) {
trace("sound will be on");
gotoAndPlay("Scene_1", 1);
} else {
trace("sound will be off");
gotoAndPlay("Scene_2", 1);
}
}
yea this wont work... it comes up on output and tells me that the "sound will be on" or off..... any other suggestions?
red penguin
12-06-2002, 05:14 PM
Well, I can only assume you have two separate sections where sound will be on or off. I don't know the layout of your movie. Make a frame label ("on") and another ("off") and then the code would look like...
on (release) {
if (_root.btn_on.selected) {
trace("sound will be on");
gotoAndPlay("on");
} else {
trace("sound will be off");
gotoAndPlay("off");
}
}
usr radioshack
12-06-2002, 05:22 PM
thanks penguin.. here is what i ve got
Scene 3 contains the buttons.....
they have to select on or off to go any further..
on they go to scene 1, off they go to scene 2...... and it plays the flash site with or without sound..... without having to load the sound if they dont want to view it with sound.. making it a quicker dload.....
hope that helps....
usr radioshack
12-06-2002, 05:25 PM
oh yea.. also... the trace thing... do i really need that?
red penguin
12-06-2002, 05:25 PM
Logically speaking, why not have the radio buttons on frame one of scene one...THat would take them to the appropriate scene according to what they input!
usr radioshack
12-06-2002, 06:19 PM
thanks for the promt respones.. i appreciate it... i tried that.. however.. it isnt working either.... oh well
binkyboo
12-06-2002, 06:20 PM
Could you post it? We could go back and forth all day long.
red penguin
12-06-2002, 06:31 PM
Maybe this would be easier...
Move this over to Newbies?
usr radioshack
12-06-2002, 07:40 PM
yea thats a good example....... since we havent been able to swtich Scenes.... do you think i can code in that when off is selected... it doesnt download the sound? or is switching scenes possible.. i havent gotten it to work yet though
the whole idea here is to create it so the user has an option on his or her time .. in case of a 56 k modem
thanks once again... i appreciate it
usr radioshack
12-06-2002, 08:03 PM
UNREAL...
ahah
i got it to work everyone....
on (release) {
if (_root.btn_on.selected) {
//trace("sound will be on");
gotoAndPlay("Scene 1", "1");
} else {
//trace("sound will be off");
gotoAndPlay("Scene 3", "1");
}
}
thanks alot for all of your help.. sorry to be persistent.. but i appreciate the quick responses....
garrett
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.