Highlighted

Dynamic text refuses to let me display numbers

Community Beginner ,
Aug 13, 2019

Copy link to clipboard

Copied

I have a dynamic text box that I want to say "Level x Complete!"  where x is the level number.

The way I have attempted to do this is textbox.text = "Level " + lvlnum.toString() + " Complete!" But what I get is "Level  Complete" instead.

When I trace( "Level " + lvlnum.toString() + " Complete!") I get the correct answer the text box refuses any stringified number I put in, for example I changed it to  textbox.text = "Level 5a5b5c " + String(5)+ " Complete!" and I get "Level abc  Complete!"

Why is it ignoring all numbers even when they are technically strings? How do I get it to display the string as I want it?

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Make sure you're embedding the font in the Properties panel. It may be one of the possible reasons.

Please let us know if this fixes the issue.

Regards,

JC

TOPICS
ActionScript

Views

74

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

Dynamic text refuses to let me display numbers

Community Beginner ,
Aug 13, 2019

Copy link to clipboard

Copied

I have a dynamic text box that I want to say "Level x Complete!"  where x is the level number.

The way I have attempted to do this is textbox.text = "Level " + lvlnum.toString() + " Complete!" But what I get is "Level  Complete" instead.

When I trace( "Level " + lvlnum.toString() + " Complete!") I get the correct answer the text box refuses any stringified number I put in, for example I changed it to  textbox.text = "Level 5a5b5c " + String(5)+ " Complete!" and I get "Level abc  Complete!"

Why is it ignoring all numbers even when they are technically strings? How do I get it to display the string as I want it?

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Make sure you're embedding the font in the Properties panel. It may be one of the possible reasons.

Please let us know if this fixes the issue.

Regards,

JC

TOPICS
ActionScript

Views

75

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
Aug 13, 2019 0
Adobe Community Professional ,
Aug 14, 2019

Copy link to clipboard

Copied

Hi.

Make sure you're embedding the font in the Properties panel. It may be one of the possible reasons.

Please let us know if this fixes the issue.

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

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
Reply
Loading...
Aug 14, 2019 0
Community Beginner ,
Aug 14, 2019

Copy link to clipboard

Copied

That was the issue, thank you

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
Reply
Loading...
Aug 14, 2019 1
Adobe Community Professional ,
Aug 14, 2019

Copy link to clipboard

Copied

You're welcome.

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

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
Reply
Loading...
Aug 14, 2019 0