Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do you use the combobox component to...

Explorer ,
Oct 10, 2017 Oct 10, 2017

...jump to frame labels based on what the user selects in the combobox dropdown component.

Found the "combobox selection change event" code snippet but am at a loss with what to put inside the brackets.

Also, I'm noticing a weird quirk with the combox on the stage.  When I first select a value, it works fine, drops down like you'd expect.   However when I select any value other than the top one, the combobox with drop up, meaning that the options will open up above the combobox.  Not sure if this is a bug or if I'm missing something. here.

1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 10, 2017 Oct 10, 2017

if your combobox is 'cb' and your cb has values that are frame numbers (first frame is 0) or frame labels, use:

if(!this.cb_change_cbk) {

    function cb_change(evt) {

       

this.gotoAndStop(evt.target.value);

       

    }

    $("#dom_overlay_container").on("change", "#cb", cb_change.bind(this));

    this.cb_change_cbk = true;

}

Translate
Community Expert ,
Oct 10, 2017 Oct 10, 2017

canvas/html5 or otherwise?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 10, 2017 Oct 10, 2017

sorry.  canvas/html5.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 10, 2017 Oct 10, 2017

if your combobox is 'cb' and your cb has values that are frame numbers (first frame is 0) or frame labels, use:

if(!this.cb_change_cbk) {

    function cb_change(evt) {

       

this.gotoAndStop(evt.target.value);

       

    }

    $("#dom_overlay_container").on("change", "#cb", cb_change.bind(this));

    this.cb_change_cbk = true;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 11, 2017 Oct 11, 2017

thanks kglad, that did it!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2017 Oct 11, 2017

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 05, 2019 Apr 05, 2019

Just wondering - how do you set the initial value of the box so it is not blank?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2019 Apr 06, 2019
LATEST

use the parameter's panel or edit the lib.an_ComboBox constructor in the js file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines