Copy link to clipboard
Copied
Hi!
From my Animate Canvas file I am calling a game-scripts.js file with the following code:
function iniciar(){
var pincel = new lib.pincel();
this.addChild(pincel);
}
When I publish my html file, the console gives me this error:
Uncaught ReferenceError: lib is not defined
at iniciar (script-juegos.js:3:15)
at lib.princesa01.frame_0 (princesa01.js?1730987426814:3682:3)
at d._runActionsRange (createjs.min.js:19:7215)
at b._runActions (createjs.min.js:19:3229)
at b._runActionsRange (createjs.min.js:19:10055)
at b._runActions (createjs.min.js:19:3229)
at b.setPosition (createjs.min.js:19:1519)
at c._updateTimeline (createjs.min.js:14:29260)
at c.advance (createjs.min.js:14:28504)
at c._tick (createjs.min.js:14:28796)
Apparently lib is not defined. Could someone help me define lib?
Thanks!
Hi.
Is the iniciar function defined within game-scripts.js? If so, you should pass the lib object as an argument to an iniciar function call in the main timeline. Like this:
// main timeline
iniciar(lib);
// game-scripts.js
function iniciar(lib)
{
// ...
}
Regards,
JC
Copy link to clipboard
Copied
Hi.
Is the iniciar function defined within game-scripts.js? If so, you should pass the lib object as an argument to an iniciar function call in the main timeline. Like this:
// main timeline
iniciar(lib);
// game-scripts.js
function iniciar(lib)
{
// ...
}
Regards,
JC
Copy link to clipboard
Copied
Solved. Thank you!
Copy link to clipboard
Copied
You're welcome!