Posted by: pierrot | on May 9, 2016
Posted in | 2 Comments » Tags: adrielle de castro
< ![CDATA[
if I get you right. “Set a name” of icon, for example “script1”, “script2”, “script3” and check it in your script.
var nameOfIcon = LL.getEvent().getItem().getName();
switch (nameOfIcon) {
case ‘script1’:
alert(‘script1’);
break;
case ‘script2’:
//code script2
case ‘script3’:
//code script3
}
//Or
check = {
‘script1’: function() {
var a = 21.34,
b = 22;
return a + b;
},
‘script2’: function() {
return nameOfIcon;
‘script3’: function() {
//check[nameOfIcon]()
Android.makeNewToast(check[nameOfIcon](), false).show();
//Or noodles “if else elseif”…
]]>
You can pass a different parameter . ex call script zzz param a
Call script zzz param b
And in the zzz script use some if .
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
< ![CDATA[
if I get you right. “Set a name” of icon, for example “script1”, “script2”, “script3” and check it in your script.
var nameOfIcon = LL.getEvent().getItem().getName();
switch (nameOfIcon) {
case ‘script1’:
alert(‘script1’);
break;
case ‘script2’:
//code script2
break;
case ‘script3’:
//code script3
break;
}
//Or
var nameOfIcon = LL.getEvent().getItem().getName();
check = {
‘script1’: function() {
var a = 21.34,
b = 22;
return a + b;
},
‘script2’: function() {
return nameOfIcon;
},
‘script3’: function() {
return nameOfIcon;
}
}
//check[nameOfIcon]()
Android.makeNewToast(check[nameOfIcon](), false).show();
//Or noodles “if else elseif”…
]]>
< ![CDATA[
You can pass a different parameter . ex call script zzz param a
Call script zzz param b
And in the zzz script use some if .
]]>