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
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.
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.
Copy link to clipboard
Copied
it's work, thank you
Copy link to clipboard
Copied
you're welcome
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;
}
});
Copy link to clipboard
Copied
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;
}