Highlighted

Separate the letters of a word and put them in text areas

Community Beginner ,
Apr 11, 2019

Copy link to clipboard

Copied

Sorry for the mistakes of language. Text translated from French.

Hello !
I looked on the Internet, on the forums, I copied codes, but I did not succeed. Can you help me please?

Langage

html 5 JS Canvas

Context
First, I get back the current year. No problem
var myyear = new Date ();
var an = myyear.getFullYear ();
this.textyear.text = an;

Problem
I would like to put each retrieved number in a different text area to be able to animate them independently.

2 in a area text, 0 in a other area text, etc...

Thank's you very much

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

Hi.

Here is a suggestion. Basically turn the year into a string and assign each letter to a different text field.

JS code:

var year = String(new Date().getFullYear());

this.firstText.txt.text = year[0];

this.secondText.txt.text = year[1];

this.thirdText.txt.text = year[2];

this.fourthText.txt.text = year[3];

FLA download:

animate_cc_html5_canvas_year_to_text_fields.zip - Google Drive

Regards,

JC

Views

87

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

Separate the letters of a word and put them in text areas

Community Beginner ,
Apr 11, 2019

Copy link to clipboard

Copied

Sorry for the mistakes of language. Text translated from French.

Hello !
I looked on the Internet, on the forums, I copied codes, but I did not succeed. Can you help me please?

Langage

html 5 JS Canvas

Context
First, I get back the current year. No problem
var myyear = new Date ();
var an = myyear.getFullYear ();
this.textyear.text = an;

Problem
I would like to put each retrieved number in a different text area to be able to animate them independently.

2 in a area text, 0 in a other area text, etc...

Thank's you very much

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

Hi.

Here is a suggestion. Basically turn the year into a string and assign each letter to a different text field.

JS code:

var year = String(new Date().getFullYear());

this.firstText.txt.text = year[0];

this.secondText.txt.text = year[1];

this.thirdText.txt.text = year[2];

this.fourthText.txt.text = year[3];

FLA download:

animate_cc_html5_canvas_year_to_text_fields.zip - Google Drive

Regards,

JC

Views

88

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
Apr 11, 2019 0
Adobe Community Professional ,
Apr 11, 2019

Copy link to clipboard

Copied

Hi.

Here is a suggestion. Basically turn the year into a string and assign each letter to a different text field.

JS code:

var year = String(new Date().getFullYear());

this.firstText.txt.text = year[0];

this.secondText.txt.text = year[1];

this.thirdText.txt.text = year[2];

this.fourthText.txt.text = year[3];

FLA download:

animate_cc_html5_canvas_year_to_text_fields.zip - Google Drive

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...
Apr 11, 2019 0
Community Beginner ,
Apr 12, 2019

Copy link to clipboard

Copied

Hello JoãoCésar,

I am struck by the simplicity of the solution. And yet, I searched. I'll try to see the basics of the JS.

Thank you very much for the quick answer and for the file. You're very helpful !

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...
Apr 12, 2019 1
Adobe Community Professional ,
Apr 12, 2019

Copy link to clipboard

Copied

Excellent!

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...
Apr 12, 2019 0