Copy link to clipboard
Copied
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
1 Correct answer
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
Copy link to clipboard
Copied
It's been suggested that
createjs.Ticker.addEventListener("tick"tickF.bnd(this));
is incorrect
Copy link to clipboard
Copied
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";
}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Andrew,
So is your issue fixed now, or do we need to look in something else?
Thanks,
Ankush
Copy link to clipboard
Copied
This has been fixed thank you.

