I'm getting started with Framer. I'm creating new layers but having trouble adding them as sub layers. e.g.
myLayers = Framer.Importer.load("imported/some-psd")
layer = new Layer(); myLayers.addSubLayer(layer);
causes the following error:Uncaught TypeError: undefined is not a function app.js:4(anonymous function)
How can I add new layers and make them referenceable?
Your layers are all in the "myLayers" namespace. So if you want to access a layer generated by a group called "background" you can do "myLayers.background.x = 123" for example.
Also, feel free to rename myLayers to anything you like.
I'm duplicating layers on the fly. I just realised I should do myLayers['Scrollables'] = new Layer; and then add sublayers to myLayers.Scrollables