up Inquisit Language Reference

onAnimate attribute

The onAnimate attribute allows custom stimulus animations to be programmed.

Member of

<button> <clock> <html> <picture> <shape> <text> <video> <port> <sound> <xid>

Syntax

/ onAnimate = { script }

Parameters

Name Type Description
script script One or more expressions, delimited by semi-colons. See help with expression syntax for more information.

Remarks

This parameter executes the enclosed custom expressions prior to presenting a stimulus animation frame. The script can change properties on a given stimulus such as size, position, or color according to custom logic in order to implement complex animations. The animation parameter must be set to "dynamic" in order for this code to executed.

Examples

The following shape includes a custom animation that alternates between to screen positions:

<shape example>
/ shape = rectangle
/ color = red
/ size = (50%, 50%)
/ position = (50%, 50%)
/ animation = dynamic(500, -1)
/ onAnimate = [
if(values.toggle)
{
shape.redsquare.hposition = 75%;
}
else
{
shape.redsquare.hposition = 50%;
}
values.toggle = !values.toggle;
]
</shape>

Copyright Millisecond Software, LLC. All rights reserved.