Is there a way for me to compile many scripts into a single script?

Is there a way for me to compile many scripts into a single script? Like when I click icon a it will do this script. Do this script when I click icon b. Thanks!

]]>

2 Commentsto Is there a way for me to compile many scripts into a single script?

  1. Anonymous says:

    < ![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”…

    ]]>

  2. Anonymous says:

    < ![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 .

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *