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

how to change object size with inputtext in html5

Community Beginner ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

I have an object (line) and input text. I want the user can change the size of the object by themself. For example, I'm typing 2 in input text, and the height of the object will be 2 cm. Can anyone tell me the code? 

Fyi: my document type is HTML5

Thanks in advance

Sorry I'm not good in English. Hope you can understand my question

TOPICS
Code

Views

274

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

Community Expert , Dec 27, 2021 Dec 27, 2021

if your textinput has instance name ti and your line is line_mc, you can scale it using the ti's value:

 

if(!this.ti_change_cbk) {
function ti_change(e) {
this.line_mc.scaleY = e.target.value;
}
$("#dom_overlay_container").on("change", "#ti", ti_change.bind(this));
this.ti_change_cbk = true;
}

 

whether it's 2cm depends on the screen size and resolution.

Votes

Translate

Translate
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

if your textinput has instance name ti and your line is line_mc, you can scale it using the ti's value:

 

if(!this.ti_change_cbk) {
function ti_change(e) {
this.line_mc.scaleY = e.target.value;
}
$("#dom_overlay_container").on("change", "#ti", ti_change.bind(this));
this.ti_change_cbk = true;
}

 

whether it's 2cm depends on the screen size and resolution.

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
Community Beginner ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

it's work, thank you

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
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

you're welcome 

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
Community Beginner ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Is it true if I  wanted the change to be applied when the button is clicked the code is like this?

 

start.on("click", function()
{
if(!this.ti_change_cbk) {
function ti_change(e) {
this.line_mc.scaleY = e.target.value;
}
$("#dom_overlay_container").on("change", "#ti", ti_change.bind(this));
this.ti_change_cbk = true;
}

});

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
Community Expert ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

LATEST

if you have a start object, use:

 

this.start.on("click"),function(){

this.line_mc.scaleY=this.ti_value;

}

 

if(!this.ti_change_cbk) {
function ti_change(e) {
this.ti_value= e.target.value;
}
$("#dom_overlay_container").on("change", "#ti", ti_change.bind(this));
this.ti_change_cbk = true;
}

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