Hello,
I'm creating some little interactive widgets. These currently exist as a paperjs canvas and some associated html elements (textfield, label etc). I wanted to instantiate the widgets dynamically via class-based scripting and add/remove them from the DOM when needed. I'd like to use the normal scope system with operators if it's possible (nice feature).
I've read the tutorials but I'm a bit confused as to the approach to take. Should I make a paperscript which is a library of functions, eg "setupWidgetA() setupWidgetB()", which sits alongside my js classes WidgetA, WidgetB, then instances of widgets can call the functions as needed? At first this seemed odd but its basically how Flash works, and the encapsulation of the visual stuff away from the HTML stuff is not so bad.
Still trying to get my head around how this will work though, can someone give me a rough idea of the approach to set up a project like this?
Thanks in advance
PS: On a side note, I seemed to have got randomly banned with my other Google account?? Google Groups sucks!
window.paperFunction = function() {};
var path;
var internalFunction = function (x, y) {
path.addPoint(new Point(x, y));
};
window.paperFunction = internalFunction;
var externalFunction = window.paperFunction;
externalFunction(0, 0);