Graphics

 View Only
  • 1.  How to get index of a user input combobox selection with a script

    Posted 07-03-2019 01:51

    Hello,

    On a text object I have a published combobox. I need to get the index of whichever element is selected by the user.

    Another approach might be to get the index of the element in the global list that informs the combobox, if that's possible.

    The ItemIndex property of an xpTextListWidget object sounds promising but I have no idea what that object type is..

    Thanks for any help!



  • 2.  RE: How to get index of a user input combobox selection with a script

    Posted 07-03-2019 22:15

    If I understand what you want to do, you could make columns and call one column "index" that would assign a number to an "index text". I'm not quite sure what you want to do ultimately.

     


    #XPression


  • 3.  RE: How to get index of a user input combobox selection with a script

    Posted 07-03-2019 22:48

    Hey Malcom,

    I'm actually not sure if combobox was the right word to use.. A text object has a user input control (template link) in the form of a dropdown. I need to get the index number of whichever element is selected from the dropdown into the script so it can drive other things. I can get the strings that populate the dropdown because the text object text matches the selection, but I don't know how to get the index of the selection.

    Since the text object itself isn't visible in the scene, one workaround idea I had was to populate the dropdown with strings that would include the index in the beginning, then separate the index part of the string in the script. For example instead of the dropdown being populated with [Red, Green, Blue] it would be [0 - Red, 1 - Green, 2 - Blue]. But I'm hoping a more dynamic solution exists.

    Thanks for the reply.


    #XPression


  • 4.  RE: How to get index of a user input combobox selection with a script

    Posted 07-04-2019 00:44


  • 5.  RE: How to get index of a user input combobox selection with a script

    Posted 07-04-2019 00:45

    you can set up columns that will assign a value to an index that can then be applied to a hidden text field. This can then be extracted and used in scripting. Scene.GetObjectByName ("Index1", index1) and used as a value in scripting. Will this help?


    #XPression


  • 6.  RE: How to get index of a user input combobox selection with a script

    Posted 07-04-2019 21:11

    Just tried it and it works perfectly. Awesome. Thanks a lot Malcom, I greatly appreciate the help!


    #XPression


  • 7.  RE: How to get index of a user input combobox selection with a script

    Posted 07-04-2019 21:31

    Glad to help. I use it for all sorts of things. For example, when a team comes in a tri code sets all the logos, background colors, and next season will pull in the correct roster excel file and set the datalinq key for the away team in stats. It also works great to select a sponsor logo on any full screens. And using transition logic I can do animated full screens back to back so they just dissolve.


    #XPression