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

Como obtener el valor de un textInput en adobe Animate Canvas?

Community Beginner ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

hola, estoy creando un pequeño proyecto, pero quiero saber como obtener el valor ingresado en un componente Input? este es mi código, pero no consigo como hacer que funcione.

this.stop();

this.textoEjemplo;

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

  console.log($(root.texoEjemplo).value());

});

Views

364

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 , Feb 03, 2017 Feb 03, 2017

try:

this.obtenerValor.addEventListener('click', clickF);

function clickF(){

textoExjemploF(this);

});

function textoEjemploF(tl) {

if(tl.textoEjemplo.value == 10){

console.log(tl.textoEjemplo.value);

}else{

console.log("no es igual");

}

}

Votes

Translate

Translate
Community Expert ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

use:

this.stop ();

this.textoEjemplo;

this.obtenerValor.on ("click", function() {}

Console.log ($(#texoEjemplo) .val ());  // assuming texoExjemplo is in the current scope/context

});

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

Hi, your answer generate an error in the print  Console.log ($(#texoEjemplo) .val ());

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

that should be console.log

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

yes, but the problem is this simbol # in console.log ($(#texoEjemplo) .val ());

There the error is generated.

I have this code,

if(!this.textoEjemplo_change_cbk) {//(textoEjemplo_change_cbk), I don't know  what will be this

  function textoEjemplo_change(evt) {

  if(evt.target.value == 10){

  console.log(evt.target.value);

  }else{

  console.log("no es igual");

  }

  }

  $("#dom_overlay_container").on("change", "#textoEjemplo", textoEjemplo_change.bind(this));

  this.textoEjemplo_change_cbk = true;

}

For get the value of Input, but I don't want use this code, I want implement in a button, for be executed when clicked and not enter.

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

let's try that again,

function ti_change(e) {

console.log(e.target.value);

}

$("#dom_overlay_container").on("change", "#texoEjemplo", ti_change.bind(this));

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

Ok friend, I'm sorry, I didn't understand me, I want implement this code in a button for be executed when I press the button. for this I have this code.

//Here I get this value of the input, but I want implement a button for executed this code doing click and not pressing enter key

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

  function textoEjemplo_change(evt) {

  if(evt.target.value == 10){

  console.log(evt.target.value);

  }else{

  console.log("no es igual");

  }

  }

  $("#dom_overlay_container").on("change", "#textoEjemplo", textoEjemplo_change.bind(this));

});

but doesn't run when clicked, only is executed when is pressed the enter key

function ti_change(e) {

console.log(e.target.value);

}

$("#dom_overlay_container").on("change", "#texoEjemplo", ti_change.bind(this));

this code only is executed when is pressed the enter key, I don't want that

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 ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

try:

this.obtenerValor.addEventListener('click', clickF);

function clickF(){

textoExjemploF(this);

});

function textoEjemploF(tl) {

if(tl.textoEjemplo.value == 10){

console.log(tl.textoEjemplo.value);

}else{

console.log("no es igual");

}

}

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 ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

thanks, kglad.com. you are genial

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 ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

LATEST

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