A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Could anybody help me with this RadioButton problem?

  1. #1
    His Flashy Highness
    Join Date
    Aug 2001
    Location
    SF Bay area
    Posts
    56
    Hi,

    I'm having a silly problem here. I'm building a small dialog box that contains 3 sets of radio buttons. They are nicely arranged in 3 groups and assigned to "group1, group2 and group3 respectively.

    The buttons have "data" values associated with them (0, 1, 2, 3 etc.)

    When I open that dialog, I want to set the radio buttons so that they show the *current* values of something. However, consistently, this doesn't work. If I set one of the buttons to be ON by default (in the properties dialog) then this button will be on, no matter what I do. If I don't set a default, all of them will be off.

    I've tried a number of different approaches to set the buttons and none worked. Here is my latest one: (the dialog is a movieClip with instance name "noteProperties")

    <pre>
    function showNoteProperties(note) {
    createNotePropertiesDialog(x,y);
    // populate it with data
    noteProperties.noteName = note; // this works!

    hlp = getPriority(note);
    trace("priority = " + hlp); // yes, it gets the right data

    var p = "p" + hlp;
    noteProperties[p].setValue(true); // don't know why this won't work using the buttongroup

    (...)
    }
    </pre>

    I obviously give the radio buttons names such as p0, p1, p2 etc. The next group is called c0, c1, c2...

    So this approach doesn't do it. I've also tried this one:

    <pre>
    noteProperties["group1"].setValue(2);
    </pre>

    and that didn't work either.

    What's going on here? Does anybody know?

    Thanks,

    Juggle5

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Tucson, AZ
    Posts
    257
    Sorry, I'm not totally clear with your question. Are you trying to set the state of the button? which would be whether it is selected or not? or set the Value of the button? Meaning your 1, 2, or 3.

  3. #3
    His Flashy Highness
    Join Date
    Aug 2001
    Location
    SF Bay area
    Posts
    56
    Originally posted by Miltaperez
    Sorry, I'm not totally clear with your question. Are you trying to set the state of the button? which would be whether it is selected or not? or set the Value of the button? Meaning your 1, 2, or 3.
    I'm trying to set whether the button is selected or not. My understanding was that the 1, 2, 3 would be the *data* of the buttongroup... or do I see this wrong?

    I mean there is "state" and "data". Now that i think of it, it's not really clear which one the "value" actually refers to... Hmmm...


  4. #4
    Senior Member
    Join Date
    Aug 2001
    Location
    Tucson, AZ
    Posts
    257
    State is whether or not the option is true or false.
    Value is a value associated with the button if it's state = true

    Hope this helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center