Is it possible to scroll the content of a folder with a script?
Is it possible to scroll the content of a folder with a script?
I have a picture of a GameBoy as Background. The folder opens by klick on the startbutton of the background picture (invisible folder icon). I like to scroll the folder content with the D-Pad of the GameBoy (invisible buttons that start a script). Can someone help me?
]]>
< ![CDATA[
Mmh, it’s possible but I don’t know if it is right…
var item=getItembyname(“folder name”);
Var cont=item.getContainer();
Var c_height=cont.getCellHeight();
Var posy=cont.getPositionY();
Cont.setPosition(0,posy+c_height,1,true);
Run this script with d-pad
+c_height to go down and -c_height to go up
I hope to be useful
]]>
< ![CDATA[
Thank you for the quick reply. I put the first part of the script as an action for the folder (hope this is correct). It says missing ; before statement in line 2.
do i have to replace “folder name” in line 1 by the folder name of my folder?
]]>
< ![CDATA[
yes and set this script as shortcut intent of d-pad items
]]>
< ![CDATA[
Ok, i did everything that you wrote, but still the error “at line 2 missing ; before statement” pops up. 🙁
]]>
< ![CDATA[
So the method is wrong XD i never used scripts on folders.
Maybe TrianguloY can help you, he is more expert than me xD
]]>
< ![CDATA[
It’s var, not Var
]]>
< ![CDATA[
Lol
]]>
< ![CDATA[
TrianguloY changing Var to var, new error ” ReferenceError in line 1 , getItemByName”
Thanks anyway
]]>
< ![CDATA[
Sascha Roehrbein remember that “name” and “label” are completely different
]]>
< ![CDATA[
Well, JavaScript is case sensitive…and you need to use available functions from available objects.
Fixed Simone Boccuzzi script should be (not tested):
var cont=LL.getEvent().getContainer();
var c_height= cont.getCellHeight();
var posy=cont.getPositionY();
cont.setPosition(cont.getPositionX(),posy+c_height,cont.getPositionScale(),true);
]]>
< ![CDATA[
TrianguloY Thank you. Almost perfect, but if i start the script via an empty object, the empty object moves. I want to scroll the content of a folder. I dont know how to start the script, what object i have to use as trigger?
]]>
< ![CDATA[
With that script, a shortcut inside the folder.
But if you want to start it from another place it can be modified
]]>
< ![CDATA[
TrianguloY I like to scroll the folder content with hidden buttons outside the folder. I have a background picture of a GameBoy. The content of the folder is over the display of the GameBoy picture. The hidden buttons are placed above the d-pad from the GameBoy picture.
]]>
< ![CDATA[
Ah, so use instead
var cont=LL.getEvent().getContainer().getItemByLabel(“your folder name”).getContainer().
]]>
< ![CDATA[
TrianguloY Thank you so much!!!! That’s it. Thx. Now i can go to bed 🙂
]]>