NOTE: For this example to work you have to run it in a web server context. This is a simple example with basic resource assigning functionality. Select the resources either in the resource column or by double clicking the right label.
Note that the js for the example code is not minified so it is readable. See resources.js.