0

I copied this code from some app but i m pasting in here(editor) it cant run it's javascript help me to know

//Called when application is started. function OnStart() { //Create a layout with objects vertically centered. lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create some text. txt = app.CreateText( "Text" ); txt.SetTextSize( 22 ); lay.AddChild( txt ); //Create an image with width of 0.1 x screen width. img = app.CreateImage( "/Sys/Img/Icon.png", 0.1 ); img.SetMargins( 0, 0.02, 0, 0 ); img.SetOnTouchDown( img_OnTouchDown ); lay.AddChild( img ); //Create a button. btn = app.CreateButton( "Button", 0.4 ); btn.SetMargins( 0, 0.02, 0, 0 ); btn.SetOnTouch( btn_OnTouch ); lay.AddChild( btn ); //Create a toggle button. tgl = app.CreateToggle( "Toggle Button", 0.4 ); tgl.SetMargins( 0, 0.02, 0, 0 ); tgl.SetOnTouch( tgl_OnTouch ); lay.AddChild( tgl ); //Create a check box. chk = app.CreateCheckBox( "Check Box" ); chk.SetMargins( 0, 0.02, 0, 0 ); chk.SetOnTouch( chk_OnTouch ); lay.AddChi

25th Jul 2020, 9:21 PM
MITARI Ivan
MITARI Ivan - avatar
1 ответ
+ 1
That's no plain Javascript I'm sure, check whether some library or framework needed to run that code first. Your code is truncated, you should've saved that code in SoloLearn and share a link to the saved code instead. Follow the below guide to know how to share link 👇 https://www.sololearn.com/post/75089/?ref=app
25th Jul 2020, 11:09 PM
Ipang