Restarting and variable scope
Hello,
I am using canvas and am setting some variables in the first frame of an animation. I want to be able to replay the animation and restart all of the children, but it seems that the vars I am setting are getting reset back to their original state when I rewind. Is there a clean way to not have the variables I am initializing change on restart?
function restart() {
//console.log(doReplay);
if (stage && stage.children) {
var i, l = stage.children.length;
for (i = 0; i < l; i++) {
var child = stage.children;
if ("gotoAndPlay" in child)
stage.gotoAndPlay(0);
}
}
}
