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

showing Object Position in dynamic text html5

Explorer ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Hi, I got stuck, I want to show my moving object (called "bulat") position in the dynamic text (called "posisix" for the x-axis and "posisiy" for the y-axis ).  as all I know in action script adobe flash, we can use as simple as

posisix.text = bulat._x

 

so I'm trying this  for adobe animate HTML5

 

var ini = this

this.addEventListener("tick", jalanbulat.bind(this));
function jalanbulat() {
ini.bulat.x += 10;
ini.bulat.y += 10;
$("#posisix").val(bulat.x);
$("#posisiy").val(bulat.y)
}

Of course it didn't work, I know it couldn't be as simple as that, but I have no idea, could anyone please help me on this? thank you.

Views

155

Translate

Translate

Report

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

Explorer , Jun 30, 2022 Jun 30, 2022

it's solved. I changed the script to:

var ini = this

 

this.addEventListener("tick", jalanbola.bind(this));
function jalanbola() {
ini.bulat.x += 10;
ini.bulat.y += 10;
ini.posisix.text = ini.bulat.x;
ini.posisiy.text = ini.bulat.y;

}

 

and it's work just like what I want.

Votes

Translate

Translate
Explorer ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

it's solved. I changed the script to:

var ini = this

 

this.addEventListener("tick", jalanbola.bind(this));
function jalanbola() {
ini.bulat.x += 10;
ini.bulat.y += 10;
ini.posisix.text = ini.bulat.x;
ini.posisiy.text = ini.bulat.y;

}

 

and it's work just like what I want.

Votes

Translate

Translate

Report

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 ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Halo,

Dari Indonesia kah ?

Votes

Translate

Translate

Report

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 ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

LATEST

iya, saya dari indonesia.

Votes

Translate

Translate

Report

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