Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | MioScript: Events SEARCH    


  TechNotes
About MioEngine
About MioScript
Adding a Login feature
Admin Panel Configuration File: Account
Admin Panel Configuration File: Alerts
Admin Panel Configuration File: Channels
Admin Panel Configuration File: Servers
Admin Panel Configuration File: Software
Admin Panel Configuration File: Tasks
Admin Panel Installation Troubleshooting
Deploying an application remotely
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to create an icon file .ico
How to debug
Installing Admin Panel on a server
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Mio File Format
MioScript: Conditions
MioScript: Events
MioScript: Functions
MioScript: Loops
MioScript: Variables and Data Types
Programming MioScript
Statistics: How to track users and actions
Where to host Mioplanet Admin Panel
XML Configuration File Format

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

  Products
All Products
MioDB
MioFactory
Mioplanet Admin Panel

TechNote
MioScript: Events

Language: MioScript


 The code declared for an event is interpreted when the event occurs, or when the statement doEvent.eventName is called.

When an event occurs, MioEngine tries to find a declaration for the event in your code.
You can also create events for your own use, for example to run a code at interval or after a delay.

To declare an event:

event.myEventName
    ...
event.end


An event can be raised with the function doEvent.
The code is not executed immediately but when MioEngine have completed the code currently running.
This is useful to create loops while the application still reacts to the user interaction.

event.load
    window.main.pos.now(100,100,200,200)
    doEvent.myLoop()
event.end

event.myLoop()
    var.inc(ptr)
    draw.main.rect(0,0,200,200,num.rgb(0,255,0))
    draw.main.text.ex(10,10, "Counter: "&ptr)
    draw.main.paint()

    doEvent.myLoop(1000)
event.end


In this example, the event myLoop is called once per second (1000 milliseconds).

For more information: event.eventName, event.end, doEvent.eventName