javascript - simple setInterval with paper.js not working -


i'm trying understand how use setinterval paper.js. made simple test, same code inside setinterval function , outside. works on latter case, not when inside setinterval. idea?

// interval (not working)//  var id = setinterval(function() {        var path = new path.circle(new point(20, 20), 30);     path.fillcolor = 'red';     var pointx = 80;     var pointy = 50;     var symbol = new symbol(path);     symbol.place(new point(pointx, pointy));     pointx = pointx+50;     pointy = pointy+50;     } }, 1000);   //no interval//  var path = new path.circle(new point(20, 20), 30);     path.fillcolor = 'red';     var pointx = 80;     var pointy = 50;     var symbol = new symbol(path);     symbol.place(new point(pointx, pointy));     pointx = pointx+50;     pointy = pointy+50;     symbol.place(new point(pointx, pointy)); 

http://jsfiddle.net/miguelrivero/2bzul/10/

thanks!

the first reason } have syntax error. second reason[s] there errors:

refused execute script 'https://raw.github.com/paperjs/paper.js/master/dist/paper.js' because mime type ('text/plain') not executable, , strict mime type checking enabled. fiddle.jshell.net/miguelrivero/2bzul/10/show/:1 uncaught syntaxerror: unexpected token } fiddle.jshell.net/miguelrivero/2bzul/10/show/:40 refused execute script 'https://raw.github.com/paperjs/paper.js/master/dist/paper.js' because mime type ('text/plain') not executable, , strict mime type checking enabled. fiddle.jshell.net/_display/:1 uncaught syntaxerror: unexpected token } fiddle.jshell.net/_display/:40 refused execute script 'https://raw.github.com/paperjs/paper.js/master/dist/paper.js' because mime type ('text/plain') not executable, , strict mime type checking enabled. fiddle.jshell.net/_display/:1 uncaught referenceerror: path not defined fiddle.jshell.net/_display/:29 uncaught referenceerror: path not defined  

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -