function onSample() { var factory = shell.factory; var rect = (factory) ? factory.createRect(10, 10, 800, 600) : null; if (rect) { shell.print("x = " + rect.x); shell.print("y = " + rect.y); shell.print("w = " + rect.width); shell.print("h = " + rect.height); } }