Trigger Help

Introduction

Triggers are IMML elements that are used to activate scripts. This allows for various interactive elements within an environment, an example of this is a button.

This is a sample of a trigger

1     <Trigger Name="MyTrigger" Event="MouseClick" Target="MyScript"></Trigger>

Child Elements

These are possible elements that can be nested in a trigger element

  • Condition
  • Network

Attributes

Event

Type imml:EventType
Use Required
Documentation Event that triggers invocation

Target

Type xs:string
Use Required
Documentation Name of the target element to execute on invocation of the trigger

Example

This example shows a simple Trigger which is activated by a mouse click. The Trigger then activates the script which has been named MyScript

1 <Trigger Name="MyTrigger" Event="MouseClick" Target="MyScript"/>
2 <Script Name="MyScript" Language="LUA">
3     function main (obj, args)
4       --do things here
5     end 
6 </Script>

See Also

Basic use of a trigger in a primitive with Hover Example