Has anyone used Events.Scroll? I want some images to load as I scroll down the page. If my import is called PSD, would I just use "SD.on Events.Scroll, -> PSD.animate"?I'm not getting anything working so far
To access a layer, you need to reference it by it's name:
PSD.myLayer.on Events.Scroll, -> ...
I want it to detect a user scrolling down the page, so don't I need Events.Scroll on all my layers?
I suggest to check your naming first.
If your imported layer name is PSD, then you should name it as PSD[“your layer group”]. so whole syntax should go like this.
PSD[“your layer group”].on Events.Scroll, ->
PSD[“your layer group”].animate //animated
If you named it properly, then you should check if you made sure target layer scrollable. you have to make a layer that is smaller than target layer(or you can make a layer group on Photoshop), and add your target layer as sublayer. like;
scrolllayer = new Layer x:0, y:0, width://smaller-than-PSD, height://same as widthscrolllayer.addSublayer(PSD[“your layer group”])scrollayer.scroll = true
thank you, i'll try this. is "your layer group" just a list of all the layer names in the PSD?
Rebecca Gold no, it's your layer group's name. you should group your layers to import properly.
Ok, so if I have PSD = Framer.Importer.load "imported/Rebecca_Homepage_OPEN", it would be (PSD["imported/Rebecca_Homepage_OPEN"])?
Sorry, i'm new to this!
No problem! You need the actual layer group name within the document.
You can't scroll the all the layers or layer groups. You can group all of them in photoshop into one layer group, name it "App Scroll" or something.
Then you would refer to PSD["App Scroll"] for the event
Make sure to set PSD["App Scroll"].height to something shorter than all of the layers inside of it to make it scroll.