Click here to Skip to main content
15,885,156 members
Articles / Programming Languages / Javascript

Hola Studio - Code Generator for JS Beginners

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
6 Jul 2016CPOL 7.5K   1  
Code Generator

Introduction

Developers can use the Hola Studio code generator, to automatically create simple, commonly used operational code. Steps: Select a component and select the event you need to monitor in the component’s events bar to load up the code editor screen. Use the code generator, choose the corresponding operation, and it will automatically generate event processing code and save it.

Background

To help beginners use Hola Studio and learn Javascript easier, Hola Studio provides the code generator. Just choose what event you want and it will show you the code!

Common Uses of the Code Generator

Code Generator Usage Examples

1) Use the win-main window button component OnClick event to close the current window and load a new window scene.

var me = this;

var win = this.win;

var initData = { };

this.openWindow("scene",

    function(retData){ console.log("window closed.");}, true, initData)

2) Click on a button to play a sound effect.

var me = this;
var win = this.win;
// Sound Effect to Play
this.playSoundEffect("hit.mp3", function onDone() {console.log("play finished");});

3) Launch Ad component while window is open.

var me = this;
var win = this.win;
// Target to Launch
win.find("hola_ads").setEnable(true);

4) Click on a label to display the text “Hello world!”

var me = this;
var win = this.win;
// Text to Display
this.setText("Hello world!");

5) Click on image to play a preset animation.

var me = this;
var win = this.win;
// Animation
this.animate("flip");

6) Click on a button to reset the scene.

var me = this;
var win = this.win;
win.replay()

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Japan Japan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --