javascript - Not able to use dialog object in smartface app studio -
hello smartface community,
this code below select gender , assign lable in smartface.
i have created dialog.
var genderlist = ["male", "female"]; var selectedindex = 0; var lblgender = new smf.ui.label({ top : "0%", left : "0%", text : "select gender.", multipleline : false, ontouch: function(e) { // ontouch event triggered dlggender_lblgender_ontouch() } }); /** * @param {eventarguments} e returns attributes specified functions * @this dialogs.dlggender */ function dlggender_self_onshow(e){ this.add(lblgender); } /** * @param {toucheventargument} e returns e.x , e.y values of touched points. * @this dlggender.lblgender */ function dlggender_lblgender_ontouch(e){ pick(genderlist, selectedindex, function (e) { dlggender.lblgender.text = genderlist[e.index]; selectedindex = e.index; }, function () {}, function () {}); }
now when run code in virtual emulator, touch event triggers below code not, throw error "can't find variable : dlggender"
dlggender.lblgender.text = genderlist[e.index];
please assist in same if missing something.
thanks, sandip kumbhar.
you should not write 'dlggender'.if write line below, code runs succesfully.
lblgender.text = genderlist[e.index];
Comments
Post a Comment