How would I run a method of a script from a particular event?
How would I run a method of a script from a particular event? I’d rather not create a new script for every little event.
]]>
« Roll-Clock (Previous Post)
(Next Post) I never reported this, because I thought it was normal. Hotword service is active even though it is not used. »
< ![CDATA[
Check for event.getSource
]]>
< ![CDATA[
How would that be implemented? Ideally I’d want to run the script once when LL loads so the main variables are set once and everything is initialised. Then I want to be able to run functions from that script that can use those main variables when certain elements are tapped or long tapped etc.
]]>
< ![CDATA[
var s=LL.getEvent().getSource();
if(s==”C_LOAD”){
test=”globalTestVar”;
}
if(s==”I_CLICK”){
Android.makeNewToast(test,true).show();
}
]]>