Highlighted

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

Explorer ,
Dec 02, 2019

Copy link to clipboard

Copied

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.

TOPICS
Code

Views

177

Likes

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

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

Explorer ,
Dec 02, 2019

Copy link to clipboard

Copied

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.

TOPICS
Code

Views

178

Likes

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
Dec 02, 2019 0

Have something to add?

Join the conversation