Skip to main content
Inspiring
December 3, 2019
Question

Adobe's input text component and if else statement not working.

  • December 3, 2019
  • 0 replies
  • 264 views

Here's my test code:

 

 

this.button1.addEventListener('click', bF.bind(this));
function bF(){
	if (this.toName.text == "") {
		this.status.text = "please enter a to name";
	} else {
		this.gotoAndStop(1);
		this.status.text = "Sending Ecard - Please Hold";
}}

 

 

 I'm using Adobe's input text field component for toName and a dynamic text for status. The code doesn't want to recognize toName... but for testing purposes, I made toName a dynamic text and left it blank.. and it works. So how can I get my component input text to be recognized in the same way a dynamic text is recognized by this code?


I think it has something to do with this:   dom_overlay_container.children["imputTextName"];

I found this on another post. I can control toName textinput component by doing:

dom_overlay_container.children["toName"].maxLength = 2;    and it lets me only enter 2 characters.

Maybe the above reference can help me find a way to get my code to directly interact with the textinput component? If anyone knows how, let me know.

This topic has been closed for replies.