Groups | Blog | Home
all groups > flash actionscript > may 2006 >

flash actionscript : Just a little syntax help ...please!


MikeMedia2
5/14/2006 7:15:54 PM
How do I define one of multiple radioButtonGroups?
How do I address a specific radio button in that group?

Here is one of the variations that I have tried:
trace(radioButtonGroup.q1.selectedData)

I want any selection in group q1 to return the value (data) of the selected
radio button component.

Thank you to whoever actually replies... even with "get lost!"
kglad
5/14/2006 7:58:45 PM
MikeMedia2
5/14/2006 10:23:48 PM
I?ve got four (4) radio button components In the Properties Panel

They are labeled respectively (a., b., c., d.)
The data for a., b., and d. is 0. c. is 10
The groupName for all 4 is q1

I can select (click) any one radio button component in group ?q1? and get a
return of the b]data of that selected radio button component (but I'm not sure
it's a "numeric" value).

However,
trace(radioButtonGroup.q1.selectedData)
returns ?undefined?.

kglad
5/15/2006 1:49:30 AM
MikeMedia2
5/15/2006 3:20:31 PM
I continue to wrestle with the constructs of AS2 syntax, i.e. what order to
identify and address radiobutton component instances. And oh yes, I have
indeed scoured help and livedocs, and tried kglad's answer in this thread.

I have four (4) radio buttons with the individual instances and parameters
established.
Each group of 4 is assigned respectively to 3 named radioGroups (see the
beginnig of this thread).
Finally, there is a standard on (release) { button script that asks for a
return from each radioGroup of the data associated with any selected
radioButton in that group .
o o o
o o o
o o o
o o o
// this is the AS coded object

Variations of what I have coded continue to return "undefined".
Here is one example of what I have written: (q.1 is the first groupName)

on (release) {
trace(q1.selection.data)
}

Thanks
kglad
5/15/2006 4:44:18 PM
if trace(q1.selection.data) returns undefined, you have no radiogroup named q1
in the scope of that button. if that button is a movieclip button, your
radiobuttons will need to be on the movieclip's timeline. if your button is a
true button, then your radiobuttons need to be on the same timeline as your
button.

and finally, when you defined your radiogroup, did you put q1 in quotes? ie,



yourFirstRadioBtnInstanceName.groupName="q1";
your2ndRadioBtnInstanceName.groupName="q1";
etc
MikeMedia2
5/16/2006 7:50:23 PM
kglad,
Thank you very much for all the attention that you have given me. Things
still aren't working though.
I really have tried to do exactly all that you have instructed.
[quoted text, click to view]
q1a.groupName="q1";
q1c.groupName="q1";
q1d.groupName="q1";
q1e.groupName="q1";
even though I think I established all this on the "Parameters Panel".

And I wrote (q1.selection.data) . Still it returned undefined after I
selected a radio button of that group, and then clicked the "Total Score"
button. (which by the way, is where all the AS is embeded.)

No matter what variation of syntax that I use the radioGroup remains
undefined. The radioGroup is named q1.
The instance and component names of the 4 buttons are q1a thru q1d.

What I am asking for is: var answer1 = the
radioGroup.radioInstance.selectedData
In order to do this, I need to understand how to call, by name, each
radioButton and the radioGroup housing them.

Because I am obviously easily confused, would you answer using the names I've
already established.

Finally, please tell me the name of a solid AS2 primer!

Thank you again.
AddThis Social Bookmark Button