This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jeff B. Léonard
Posted May 11 - Read on Facebook

Does anyone know if it's possible to create an instance of an object in order to duplicate it to add different events to it ?

For example if there's a button that gets used in different places, but depending on where that button is in the flow it would have a different action assigned to it...

Any pointers would be greatly appreciated.

2 Comments

Jeff B. Léonard

U-Kyung Kim - Any idea how I may be able to achieve this... I tried something like this:

addVehicleButtons = ["vehicle1", "vehicle2", "vehicle3"]
for addVehicleButton in addVehicleButtons
addVehicle = new Layer
width: 331
height: 423
#y: 332
image: "images/addVehicleButton1.png"
parent: VehiclesContainer
addVehicleButtons.push(addVehicleButton)
addVehicleButton[0].x = 329
addVehicleButton[1].x = 740
addVehicleButton[2].x = 740

U-Kyung Kim

I typically use a for loop like you've done to create multiple layers. The layer.copy() function may help as well. You can then add events to the layers as you would like. Hope this helps! :)

Read the entire post on Facebook