0

so I am using Animate CC outputting to Canvas, and have the following in my script:

var width = canvas.width; 
var height = canvas.height;

console.log(width, height);

Question: When I open the console in the preview window and type in "canvas.width" or canvas.height it returns the correct values. However the console.log doesn't print the variable values. Any ideas what I am missing here?

Thanks!

user2163224
  • 131
  • 2
  • 3
  • 12
  • If I add just your code in a empty Animate project (without adding any elements), and I test it, in the console it outputs both values. The same goes for the HTML/JS generated from that proyect. – cristiancajiaos Aug 02 '17 at 22:26
  • Interesting. Looks like it doesn't print in Firefox, but in Chrome it does indeed print the variable. Any workaround for this? Thanks – user2163224 Aug 03 '17 at 14:52
  • It's weird it doesn't print on Firefox. In my case it does. Have you checked the [toolbar](https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Console_messages#Filtering_by_category) in the console in the Firefox Developer Tools? Your console log should be in the Logging category. – cristiancajiaos Aug 03 '17 at 19:30

1 Answers1

0

I'm not sure about the scope but maybe try console.log(this.width, this.height); or

this.width = width;
this.height = height;

console.log(this.width, this.height);

Only because I know Create.js has a scope limiter to try and keep locals local. Just guessing but hope it works

markwalker_
  • 12,078
  • 7
  • 62
  • 99
Papergrave
  • 26
  • 3