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

String Characters are removed from String array

New Here ,
Oct 23, 2024 Oct 23, 2024

Copy link to clipboard

Copied

Hello,
I have defined a String array and would like to iterate through the entries: 

var evArr: Array = new Array("empty", "ev1", "ev2", "ev3", "ev4", "ev5", "ev6", "ev7", "ev8", "ev9", "ev10", "ev11", "ev12", "ev13", "ev14", "ev15", "ev16", "ev17"); 

var countEvs:Number = 17;

var concatArray: String;
var i:Number;	
for (i = 1; i <= countEvs; i++) {
	concatArray= concatArray+ evArr[i];
}
textField.text = concatArray;


As a result I get:
"nulle1e2e3ee5e6e7eee1e11e12e13e1e15e16e17"

Does anyone know why are the "v"s removed? Why is there a problem with the numbers 4, 8, 9, 10, 14?

Thank you a lot in advace!

TOPICS
ActionScript , Error

Views

111

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 , Oct 23, 2024 Oct 23, 2024

Hi.

 

You should initialize concatArray as "". Other than that, if you're not seeing those characters, the font family you're using is probably not embedded.

 

But if all you want to do is to display the items from the array, starting from the index 1, in a text field, I think it's eaiser to use some methods from the Array class. For example:

 

textField.text = evArr.slice(1).join("");

 


Regards,

JC

Votes

Translate

Translate
Community Expert ,
Oct 23, 2024 Oct 23, 2024

Copy link to clipboard

Copied

Hi.

 

You should initialize concatArray as "". Other than that, if you're not seeing those characters, the font family you're using is probably not embedded.

 

But if all you want to do is to display the items from the array, starting from the index 1, in a text field, I think it's eaiser to use some methods from the Array class. For example:

 

textField.text = evArr.slice(1).join("");

 


Regards,

JC

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
New Here ,
Oct 23, 2024 Oct 23, 2024

Copy link to clipboard

Copied

Hi,
Thanks for the tip regarding the font, it was indeed the reason. A different font worked!
Best regards

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 ,
Oct 23, 2024 Oct 23, 2024

Copy link to clipboard

Copied

LATEST

Nice! 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