Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > AutoPlay Media Studio 4.0 > AutoPlay Media Studio 4.0 Examples

 
 
Thread Tools Display Modes
  #1  
Old 10-15-2002
Support Support is offline
Super Moderator
 
Join Date: Jan 2000
Location: Indigo Rose Corporation
Posts: 204
HOWTO: Display Conditional Text Based Upon a List Box Selection

HOWTO: Display Conditional Text Based Upon a List Box Selection

HOWTO: Display Conditional Text Based Upon a List Box Selection

Document ID: IR04023
The information in this article applies to:
  • AutoPlay Media Studio 4.0

SUMMARY

This article explains how to display conditional text based upon a list box selection.

DISCUSSION

When a user selects an entry in a list box object in AutoPlay Media Studio 4.0 it is sometimes useful to display some conditional text to the user that will explain their selection. The best way to accomplish this is to use the DATA member of each list box item.

In general list box items are formatted in the following manner:

NAME:ATA

Where NAME is the text that will be displayed in the list box during runtime, and DATA is the data that is associated with this list box item.

So in order to display conditional text based upon a list box selection we will store the condition text as the DATA member of each list box entry. For example:

Product1::This is Product one.
Product2::This is Product two.
Product3::This is Product three.

Now that we have the conditional text stored in our list box items we simply need a method to retrieve that information, and then display it when the user selects one of the items in the list box. In order accomplish this the following actions can be used on the list box object's "On Selection Change" event:

%Index% = ListBoxObject[ListBox1].GetSelected
%ItemData% = ListBoxObject[ListBox1].GetItemData (%Index%)
TextObject[txtDescription].SetText ("%ItemData%")

The first action gets the index of the currently selected item and stores it in %Index%. The second action then gets the data associated with the list box item at position %Index% and stores it in %ItemData%. At this point %ItemData% holds the conditional text of the currently selected list box item. The last action then sets the text of a Text object named "txtDescription" to %ItemData%. This will display the conditional text in the textbox so that the user can view it. There are other methods that can be used to display the conditional text, but setting the text of a text object is the quickest and easiest.

MORE INFORMATION

For more information please see the following topics in the AutoPlay Media Studio 4.0 Help:

  • Command Reference | Actions | List Box Object | Get Selected
  • Command Reference | Actions | List Box Object | Get Item Data
  • Command Reference | Actions | Text Object | Set Text
  • Command Reference | Objects | List Box Object
  • KEYWORDS: AutoPlay Media Studio 4.0, List Box Object, Conditional Text, Selection


    Last reviewed: October 30, 2002
    Copyright © 2002 Indigo Rose Corporation. All rights reserved.
     

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is On



    All times are GMT -6. The time now is 01:31 AM.


    Powered by vBulletin® Version 3.8.4
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
    Indigo Rose Software