Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions dropdown notify() issue.

  • dropdown notify() issue.

    Posted by Fabio Apelbaum on May 9, 2016 at 9:59 pm

    Hi guys! as always! thank you for all your help!!!

    I have a user interface which includes a dropdown with 8 options and a checkbox button that I would like when unchecked to select option #2 from the dropdown, but when checked back again to go to the previous selected option. So, if user had option #6 selected prior to unchecking the button, and then the user decides to check it back again, I would like it to go back to option #6.

    In the process of writing this script, I noticed that no matter if I do or do not insert the dropdownBar.notify() inside the checkbox button, it will still change my dropdown selection by just typing dropdownBar.selection = (the value)…

    Im including the script that I came up with.. which as explained, it does not work cause Im not sure how else to store the old selection… Anyways, if you happen to know how can I fix my code or a way to retrieve the previews selection, I will truly appreciate it!

    Thanks in advance!

    var savedOptionValue = dropdownBar.selection;
    var OptionValue = savedOptionValue

    checkboxHeadlineProp.onClick = function(){ // CHECKBOX FOR HEADLINE/PROPERTY (ON or OFF)
    if(checkboxHeadlineProp.value == true){

    dropdownBar.selection = savedOptionValue
    //dropdownBar.notify(); //NO MATTER IF INCLUDED OR NOT IN THE CODE, IT STILL CHANGES MY DROPDOWN SELECTION.

    }else{

    dropdownBar.selection = OptionValue
    dropdownBar.selection = 2;
    //dropdownBar.notify() //NO MATTER IF INCLUDED, IT STILL CHANGES MY DROPDOWN SELECTION.
    dropdownBar.selection = OptionValue //Old stored value which I was planning to use after the notify() for when checkbox is ON.
    }
    };

    Fabio Apelbaum replied 10 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 9, 2016 at 10:24 pm

    I would think you have to update saveOptionValue when the checkbox is unchecked. That section might look like this:


    }else{
    saveOptionValue = dropdownBar.selection;
    dropdownBar.selection = 2;
    }

    Dan

  • Fabio Apelbaum

    May 9, 2016 at 10:37 pm

    As always Dan! you are the man!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy