getting the stage from a container in kineticjs
- by seinecle
I have this stage associated to a container:
html:
<div id="container">
script 1:
var stageInFirstScript = new Kinetic.Stage({
container: document.getElementById('container'),
width: this.SKETCH_WIDTH,
height: this.SKETCH_HEIGTH
});
In a second script, I need to manipulate the shapes on the stage I just created. Is it possible to retrieve stageInFirstScript with something like this?
script 2:
var stageInSecondScript = document.getElementById('container').RetrieveExistingStage();
//now I have retrieved stageInFirstScript
//I can add shapes to it, etc....
Any help or alternative solution would be appreciated!