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

Changing the position of an object @ a certain ComboBox value (HTML5 canvas)

Community Beginner ,
Dec 06, 2018 Dec 06, 2018

Hi all:),

I'm trying to change the position of objectX to a certain coordinate after the user is using a ComboBox value. To do this I'm using the following code. The ComboBox is basically a dropdown with values from 1-10. Ive tried both if (value == 2)  and if (value == "2"), but this just does not seem to work. Anyone knows how to do this?

Thanks very much in advance!

The code:

var _this = this;

$('#dom_overlay_container').on('change', '#Touchpoint1_Dropdown', function() {

     var value = $('#Touchpoint1_Dropdown').val();

     if (value == 2) {

          this.objectX.x = 200;

          this.objectX.y = 100;

     }

}.bind(_this));

172
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 Beginner , Dec 06, 2018 Dec 06, 2018

Apparently I used the wrong command to get the value of the ComboBox. Right now I succeeded by using

$('#dom_overlay_container').on('change', '#Touchpoint1_Dropdown', function () {

if (Touchpoint1_Dropdown.selectedIndex == 0) {

this.objectX.x = 200;

this.objectX.y = 700;

}

Translate
Community Beginner ,
Dec 06, 2018 Dec 06, 2018
LATEST

Apparently I used the wrong command to get the value of the ComboBox. Right now I succeeded by using

$('#dom_overlay_container').on('change', '#Touchpoint1_Dropdown', function () {

if (Touchpoint1_Dropdown.selectedIndex == 0) {

this.objectX.x = 200;

this.objectX.y = 700;

}

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