ed209
ed209

Reputation: 11303

Adding a sub layer in FramerJS

I'm trying to add a sub layer to the main set of layers in a framer prototype:

myLayers = Framer.Importer.load("imported/some-psd")

layer = new Layer();
myLayers.addSubLayer(layer);

But I get the following error:

Uncaught TypeError: undefined is not a function app.js:4
(anonymous function)

Upvotes: 0

Views: 1206

Answers (1)

Adam
Adam

Reputation: 301

Try adding the superLayer property to the layer var, rather than adding layer to myLayers as a subLayer

In other words:

myLayers = Framer.Importer.load("import/some-psd")
layer = new Layer()
    superLayer: myLayers

Or

layer.superLayer = myLayers

Upvotes: 2

Related Questions