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

Countdown to a date: Syntax and loading issue

Community Beginner ,
Aug 12, 2018 Aug 12, 2018

I am having issues loading (browser) the JavaScript assigned to a text field in Adobe Animate CC.

The code is as follows

---------------

var specific_d=new Date(2018, 8, 24);

createjs.Ticker.addEventListener("tick"tickF.bnd(this));

function tickF(){

var d=new Date();

this.countdown_txt.text=Math.round((specific_d.getTime()-d.getTime())/(1000*60*60*24))+" days";

}

---------------------

The error messages are (console.log)

Uncaught SyntaxError: missing ) after argument list

and

Uncaught ReferenceError: AdobeAn is not defined

    at init at onload

Thank you in advance,

Andrew

516
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 Beginner , Aug 12, 2018 Aug 12, 2018

So if I change the date to var specific_d=new Date(2018, 7, 24); It gives me the correct number of days to the 24 August

Translate
Community Beginner ,
Aug 12, 2018 Aug 12, 2018

It's been suggested that

createjs.Ticker.addEventListener("tick"tickF.bnd(this));

is incorrect

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 ,
Aug 12, 2018 Aug 12, 2018

I have picked up the errors

1. ("tick"tickF.bnd(this)); - typo - bind
2. ("tick"tickF.bnd(this)); - typo - "tick",

The stange thing is that the countdown is to September and not August.

var specific_d=new Date(2018, 8, 24);

createjs.Ticker.addEventListener("tick", tickF.bind(this));

function tickF(){

var d=new Date();

this.countdown_txt.text=Math.round((specific_d.getTime()-d.getTime())/(1000*60*60*24))+" days";

}

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 ,
Aug 12, 2018 Aug 12, 2018

So if I change the date to var specific_d=new Date(2018, 7, 24); It gives me the correct number of days to the 24 August

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
Aug 13, 2018 Aug 13, 2018

Hi Andrew,

So is your issue fixed now, or do we need to look in something else?

Thanks,

Ankush

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 ,
Aug 13, 2018 Aug 13, 2018
LATEST

This has been fixed thank you.

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