HTML5 Canvas using global script to add movie clips to the stage?
Hi! I'm working my way through learning HTML5, and I'm trying to figure out global scripting. Is there a way to add a movie clip from the library to the stage using a global script? Currently I would do something like this in the actions panel:
var _this = this;
var MyMoveClip = new lib.myMovieClip_mc();
function addMovieClip() {
_this.addChildAt(MyMoveClip , 1);
}
But when I try to do a similar thing with global scripting:
function GlobalScript (){
var MyMoveClip = new lib.myMovieClip_mc();
exportRoot.addChildAt(MyMoveClip, 1);
}
I get an error saying the script can't find "lib"
Is this something I will just have to do in the actions panel?
Thanks!