Showing posts with label variables. Show all posts
Showing posts with label variables. Show all posts

<assign name="" expr=""/>

Assigns a value to a specified variable.

The expression (expr="") can contain constants (within single quotes) or other variables (without quotes). It can also contain the addition (+), subtraction (-), multiplication (*) or division (/) operators.

Variables do not have to be explicitly declared. They are automatically declared when used.

Child of: <button>, <click>, <image>, <media>*, <media_overlay>, <mouse_click>, <mouse_down>, <mouse_move>, <mouse_out>, <mouse_over>, <node name="">, <press>, <release>, <settings>
Parent of: Nothing

* Note that an assign within a <button>, <image>, <media> or <media_overlay> tag will only be executed if the user clicks the button, image or media.

Examples:

<assign name="a" expr="'yes'"/>
after: a = yes

<assign name="a" expr="'1'+'2'"/>
after: a = 3

before: a = 3
<assign name="b" expr="'5'-a"/>
after: b = 2

before: a = 3
<assign name="b" expr="'1'+'a'"/>
after: b = 1a

before: a = 2
<assign name="b" expr="a*'7'"/>
after: b = 14

before: a = 12
<assign name="b" expr="a/'3'"/>
after: b = 4

Working example: Search for <assign name="" expr=""/> in the file trivia_demo.xml.

<delimiter>

The delimiter for data that is returned from a web service (see <web_service>) or a long polling session (see <long_poll connect="">).

Child of: <long_poll connect="">, <web_service>
Parent of: Nothing

Example:

<delimiter>,</delimiter>

<get>

Retrieves the specified variable from the user's Flash cookie if the variable exists. If it doesn't exist, the variable is created and given a value of "".

Child of: <node name="">
Parent of: Nothing

Example:

<get>user_session_count</get>

Working example: Search for <get></get> in the file trivia_demo.xml.

<get_info commid="" responses="">

Generates and returns application and session IDs for use in logging or polling (e.g., in a voice recognition session).

This tag can also request the value of any number of cookies using the <cookie> tag. Each requested cookie value is returned in a variable of the same name as the cookie itself.

If <next_node> is present, advances to the specified node upon completion.

If commid is set to YES, a communication ID will be generated and returned for use in a subsequent long polling session. The default value of commid is NO.

If responses is set to YES, the communication ID will send the canned messages CONNECTED and OK in an SMS or IM interaction. The default value of responses is YES.

This tag makes the following variables available for evaluation (in addition to any requested cookie values):

ID – the Interactivation ID for the application. ID is stored in the user's HTML cookies and won't change unless the user deletes the cookie.
COMMID – a communications ID for use in a subsequent long polling session. This variable is only returned if the attribute commid is set to YES.
IPADDRESS – the user's IP address.

Child of: <node name="">
Parent of: <cookie>, <next_node>, <error_node>

Example:

<get_info commid="YES" responses="NO">
            <cookie>Cookie1</cookie>
            <cookie>Cookie2</cookie>
            <cookie>Cookie3</cookie>
            <next_node>a_node</next_node>
            <error_node>error_node</error_node>
</get_info>

<if cond="">

A conditional statement used to determine what the application executes on the basis of the evaluation of one or more variables.

The value in cond="" must be an expression containing the following three elements: 1) a value, variable or function; 2) an operator; and 3) another value, variable or function.

There must be no spaces in the expression other than spaces that may be present in a text string value.

All variables used in the conditional statement must have been defined (using <assign name=""/> or <get>) before the conditional statement, either above the conditional statement in the same node, in a previous node, or in <settings> (using <assign name="" expr=""/>). If they are undefined, they will cause an error. Likewise, if an existing variable is assigned a new value using <assign name="" expr=""/>, this must be done before the conditional statement if the new value is to be evaluated.

Constants in conditional statements must be placed in single quotes; variables must not.

Allowed operators are:
== is equal to*
!= is not equal to
> is greater than
< is less than
>= is greater than or equal to
<= is less than or equal to
* Note that two equal signs are used in evaluation rather than assignment.

Child of: <node name=""> or any multi-line tag at any level within <node name="">
Parent of: Nothing

Example:

<medias>
<if cond="user_visits=='1'">
                        <media>
                                    <file>first_time_welcome.mp4</asset>
</media>
<elseif cond="user_visits=='2'"/>
                        <media>
                                    <file>second_time_welcome.mp4</asset>
</media>
<else/>
                        <media>
                                    <file>generic_welcome.mp4</asset>
</media>
</if>
</medias>

Working example: Search for <if cond="">...<elseif cond=""/>...<else/>...</if> in the file trivia_demo.xml.

<item label="" data=""/>

An individual selection within a drop-down menu.

The value in label="" is displayed to the user; the value in data="" is written to a variable named dropdown_value when the user selects that item. The variable can then be evaluated and used in the next node.

Child of: <items>
Parent of: Nothing
See also: <dropdown>

Example:

<item label="Choice 1" data="1"/>

<mouse_click>

Executes the specified actions upon mouse click and release over the image defined by the parent <image name=""> tag. (If the mouse is clicked without release, <mouse_down> must be used.)

This tag makes the following variables available for evaluation:

image_click_name – the name of the image that was clicked.
image_click_x – the X position of the cursor at the moment of the click (relative to the upper left corner of the image).
image_click_y – the Y position of the cursor at the moment of the click (relative to the upper left corner of the image).

Child of: <image name="">
Parent of: Any child of <node name="">
See also: <mouse_down>, <mouse_move>, <mouse_out>, <mouse_over>

Example:

<image name="my_image">
            ...
<mouse_click>
...
</mouse_click>
</image>

<mouse_down>

Executes the specified actions upon mouse click without release over the image defined by the parent <image name=""> tag. (If the mouse is clicked and released, <mouse_click> must be used.)

This tag makes the following variables available for evaluation:

image_down_name – the name of the image over which the mouse down is being performed.
image_down_x – the current X position of the cursor during the mouse down (relative to the upper left corner of the image).
image_down_y – the current Y position of the cursor during the mouse down (relative to the upper left corner of the image).

Child of: <image name="">
Parent of: Any child of <node name="">
See also: <mouse_click>, <mouse_move>, <mouse_out>, <mouse_over>

Example:

<image name="my_image">
            ...
<mouse_down>
...
</mouse_down>
</image>

<mouse_move>

Executes the specified actions upon movement of the cursor over the image defined by the parent <image name=""> tag.

This tag makes the following variables available for evaluation:

image_move_name – the name of the image over which the mouse movement is being performed.
image_move_x – the current X position of the cursor during the mouse movement (relative to the upper left corner of the image).
image_move_y – the current Y position of the cursor during the mouse movement (relative to the upper left corner of the image).

Child of: <image name="">
Parent of: Any child of <node name="">
See also: <mouse_click>, <mouse_down>, <mouse_out>, <mouse_over>

Example:

<image name="my_image">
            ...
<mouse_move>
...
</mouse_move>
</image>

<mouse_out>

Executes the specified actions when the mouse comes off of an image defined by the parent <graphical_button name=""> or <image name=""> tag.

This tag makes the following variables available for evaluation:

image_out_name – the name of the image off of which the mouse has moved.
image_out_x – the X position of the cursor at the moment the mouse has moved off of the image (relative to the upper left corner of the image).
image_move_y – the Y position of the cursor at the moment the mouse has moved off of the image (relative to the upper left corner of the image).

Child of: <graphical_button name=””>, <image name="">
Parent of: Any child of <node name="">
See also: <mouse_click>, <mouse_down>, <mouse_move>, <mouse_over>

Example:

<image name="my_image">
            ...
<mouse_out>
...
</mouse_out>
</image>

<mouse_over>

Executes the specified actions upon mouseover of the image defined by the parent <graphical_button name=""> or <image name=""> tag.

Child of: <graphical_button name=””>, <image name="">
Parent of: Any child of <node name="">
See also: <mouse_click>, <mouse_down>, <mouse_move>, <mouse_out>

Example:

<image name="my_image">
            ...
<mouse_over>
...
</mouse_over>
</image>

<set>

Writes the specified variable to the user's Flash cookie.

Will cause an error if the variable does not exist. It must have previously been defined using <assign name="" expr=""/> or <get>.

Child of: <node name="">
Parent of: Nothing

Example:

<set>my_variable</set>

Working example: Search for <set></set> in the file trivia_demo.xml.

<variable_name>

In a text input form, the name of the variable to which the user input is written.

The variable does not have to have been previously defined.

Child of: <input>
Parent of: Nothing

Example:

<variable_name>user_email</variable_name>

<web_service>

Calls a web service and places the return value into a variable named web_service_value.

Delimited data returned by the web service is placed into an array named web_service_value as follows: web_service_value[1], web_service_value[2], web_service_value[3], etc.


Example:

<web_service>
            <url>http://www.my_site.com/my_web_service.asp</url>
            <next_node>a_node</next_node>
<delimiter>,</delimiter>
<obfuscate>YES</obfuscate>
</web_service>