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

Dates to Text Box

Community Beginner ,
Jan 05, 2016 Jan 05, 2016

I have a date something like this below.  I want to convert it so that I can put it into a text field.  Anyone know how to do this?  Thanks.

var currentDate=new Date();

  var month = currentDate.getMonth() + 1;

  var day = currentDate.getDate();

  var year = currentDate.getFullYear()

  trace(month + "/" + day + "/" + year);

TOPICS
ActionScript
535
Translate
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 , Jan 05, 2016 Jan 05, 2016

embed your font.

Translate
Community Expert ,
Jan 05, 2016 Jan 05, 2016

use:

var currentDate=new Date();

  var month = currentDate.getMonth() + 1;

  var day = currentDate.getDate();

  var year = currentDate.getFullYear()

your_textfield.text=month + "/" + day + "/" + year;

Translate
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 Beginner ,
Jan 05, 2016 Jan 05, 2016

i am using a Dynamic Text field and I get an empty box when I use that.  However if i put a word in quotes "Hello" it shows up no problem.

EDIT

if I open a new document and use that code it works perfectly.  Just not in the document I am working on.  Any ideas why that would be?

Translate
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 ,
Jan 05, 2016 Jan 05, 2016

embed your font.

Translate
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 Beginner ,
Jan 06, 2016 Jan 06, 2016

Thanks

Translate
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 ,
Jan 06, 2016 Jan 06, 2016
LATEST

you're welcome.

Translate
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