# Select the device to be rendered in Framer.Device.deviceType = "nexus-5-black" # This imports all the layers for "design" into PSD PSD = Framer.Importer.load "imported/design" # All layers are made visible PSD.artboardB.visible = true PSD.artboardC.visible = true PSD.artboardD.visible = true PSD.artboardE.visible = true PSD.artboardF.visible = true PSD.artboardG.visible = true # Shortcuts to views headphones = PSD.artboardA homescreen = PSD.artboardB groupforming = PSD.artboardC wait = PSD.artboardD totem = PSD.artboardE shake = PSD.artboardF congratulations = PSD.artboardG btn_groups = PSD.btn_groups # Hide the navigation bar PSD.navBar.visible = false # For a persistent UI, we set their superLayer (parent layer) to the device. PSD.statusBar.superLayer = Framer.Device.screen PSD.browser.superLayer = Framer.Device.screen PSD.navBar.superLayer = Framer.Device.screen # Wrap the imported content layers pages = PageComponent.wrap(PSD.artboardA) pages.scrollVertical = false # Add the other layers as pages pages.addPage(headphones) pages.addPage(homescreen, "right") pages.addPage(groupforming, "right") pages.addPage(wait, "right") pages.addPage(totem, "right") pages.addPage(shake, "right") pages.addPage(congratulations, "right") pages.snapToPage(homescreen, true) # this line works btn_groups.on Events.Click, (event, layer) -> print "This layer was clicked", layer.name pages.snapToPage(groupforming, true) # this line doesn't