Jump to content

Programming Help:Play Method

From Agentpedia, the Microsoft Agent encyclopedia
Play Method
Plays the specified animation for the specified character.
Introduced in version:Microsoft Agent 1.5
Removed in version: Still in use
Allowed values:AnimationName (required)
Default value:None


Parts

Part Description
AnimationName Required. A string that specifies the name of an animation.

Examples

Inline example (VB.NET)
Genie.Play("Confused")
Advanced example (VB.NET)
' This code example loads all the animations of the character into ComboBox1 after the timer is activated across 2 forms with Button4 as the play button
   Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Dim Enume As IEnumerator =
            Genie.AnimationNames.GetEnumerator()

        While Enume.MoveNext
            Form3.ComboBox1.Items.Add(Enume.Current)
        End While

        Form3.ComboBox1.Text = Form3.ComboBox1.Items.Item(0)
        Timer1.Dispose()
    End Sub
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Form1.Genie.Play(ComboBox1.Text)
    End Sub

Remarks

An animation's name is defined when the character is compiled with the Microsoft Agent Character Editor. Before an animation is played, the Microsoft Agent Server will attempt to play the assigned "Return" animation for the previous animation (if applicable).