#EBguide Frequently Used Code ** Loop ** ``` let v:k=0; v:kk=0; in while (v:k<3) { ............. ............. v:k+=1 } ``` ** Trigger Event** ``` function(v:touchId::int, v:x::int, v:y::int, v:fingerId::int) { fire_delayed 0, ev:"back"() true } ``` **List from datapool** ``` function(v:arg0::bool) { v:this->switch_lable.text=dp:switch_array[v:this.lineIndex]; false } ``` **Toggle a Dynamic State Machine** ``` function() { f:pushDynamicStateMachine(popup_stack:Main, sm:"03 two independent section",1 ); } ``` **Button Toggle on off** ``` function(v:touchId::int, v:x::int, v:y::int, v:fingerId::int) { if (dp:"05button1On" == 0) { dp:"05button1On" = 1 v:this.image=v:this."on" } else { dp:"05button1On" = 0 v:this.image=v:this."off" } true } ``` **Get Parameter from event (P79)** ``` function(v:arg0::bool) { match_event v:triggerEvent = ev:showAlertTitle in v:this.text=dp:alertTitleArray[v:triggerEvent.alertIndex] false } ``` ** play animation (write this in conditional script) ** ``` function(v:arg0::bool) { f:animation_play(v:this->"dummy") true } ```