dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: MX Component UI Frustration! (guru helpie)

  1. #1

    MX Component UI Frustration! (guru helpie)

    I cant figure this out



    I've got a lot of ui radio buttons and chekboxes (around 50 or so) and when some are ON, some turn off and are unchecked... most of it is pretty easy except for a few options that have insane amount of logic to em,

    I'm using name.setEnabled(true), getEnabled, setValue, getVal..bla bla bla,

    And each button calls a master function that has all the rules for each box (i'de break it up but all the buttons are related to each other somehow and need to check everything at any change)

    Now I've gotten some of it to work except i keep getting an infinite loop when i turn options on,

    I traced my script and found out every time i setValue(true) to a button it activates my script all over again... so if i hit a button that turns on 10 buttons, my script runs like 50 times and crashes

    How can i get around this ?

    Can i set a radio button to true without calling its Handeler ???

  2. #2

    forget all the other crap this is all i need

    Can i set a radio button to true without calling its Handeler ???

  3. #3
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    you may wanna double-check this in the actionscript dictionary, 'cause i'm not where i can see Flash right now..
    but i believe this is right:
    Code:
    myRadioButton.setState() = false;
    like i said, double check it... the script may not be exact, but the method is documented in the reference panel

    later,
    -myk

  4. #4
    hmmmm i'm retarded.



    setValue() was working (kinda), but i completley forgot about setState()



    Thanks

  5. #5
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    is that the right script? just curious..

    -myk

  6. #6
    yea, that works for radio buttons only



    But I'm still having a damn hard time getting this to work, everytime a button changes it loads the whole freakin script over again,

    Are there any site that use a lot of disabled radio buttons ? Or somthing similar...


    I'm thinking maybe a case / switch statment thingie... but i have a LOT of logic here, i dont know if that would be faster or not ...

  7. #7
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    lets start over. what are you trying to accomplish? Are the wrong buttons turning themselves off when you click one thats not in the same group?
    if you can, just clarify, and we'll try again.

    -myk

  8. #8
    ok, i have a list of thing to make a car.. (i know this looks trivial but its very important to my work)


    ie:

    make
    model
    color
    options
    accessories


    The logic comes in with where:

    You cant get X option with X color if model == X, but can if model == Y... etc etc

    Right now i have a fucntion that all the boxes and radios call called process()

    ... in process ()
    {
    if (make1.getState==true)
    {
    option1.setValue(true);
    option2.setValue(true);
    option3.setState(true);
    option4.setState(false);
    }
    ...
    ...
    etc etc etc, but i gets REALLY complicated, like

    if (make1.getState==true && !option4.getState()}
    {
    model4.setState(false);
    TurnOffAllColorsFunc(true);
    }

    ... ok so it gets more complicated then that, but my head hurts as it is

  9. #9
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    dont know if i'll be of much help tonight, but if you can post an FLA, i'm sure somebody will be able to.
    Its hard to digest the partial code, but if we can see the whole project thus far, it'll help us help you.

    thanks,
    -myk

  10. #10
    ARRR!!!


    I got pissed of and made a setInterval that just ran thru everything all the time, but now it just keeps triggering its own defaults over and over

    i need to set a do-once variable and bla bla bla bla bla


    there has to be a better way of doing this.

  11. #11
    ok, if anyone ever needs to do this,

    make a setInterval(fucntion, refreshrate), then in you function have all the rules for your boxes and radios

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