Monday, December 22, 2003

A Small HTML file using Microsoft Agent

<Html>
<Head>
 <Title>X-Mas Greetings ...Designed and Developed by M. Vadivel </Title>
</Head>
<Body bgcolor=black>
<!--
Sets or retrieves the URL of the component. If the value for version is set as -1 the component is downloaded from the server if the release date is later than the installation date on the client computer. If the compnent is installed on the client computer and the release date is the same or earlier than the installation date only an HTTP header transaction occurs.

The below line would take care of installing the agent control and the TTS engine if it is not already present in the end
user PC
-->

<OBJECT ID="AgentControl" width=0 height=0 CLASSID="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F" CODEBASE="#VERSION=2,0,0,0">
</OBJECT>

<OBJECT ID="TruVoice" width=0 height=0 CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575" CODEBASE="#VERSION=6,0,0,0">
</OBJECT>

<Script language=VBScript>
Dim Genie
Sub window_OnLoad
  AgentControl.Connected = True ' needed for IE3
  AgentControl.Characters.Load "Genie", "http://agent.microsoft.com/agent2/chars/genie/genie.acf"
  Set Genie = AgentControl.Characters("Genie")
  Genie.LanguageID = &H0409 ' needed under some conditions (English)
  Genie.Get "state", "Showing, Speaking"
  Genie.Get "animation", "DoMagic2, DoMagic2Return"
  Genie.Show
  Genie.Get "state", "Hiding"

  Genie.Play "DoMagic2"
  Genie.Speak "Dear friends Merry Chrismas."
End Sub
</Script>

</Body>
</Html>

Till the above line save it as a HTML file. On firing that HTML you could see the Genie in action :)

There are lots of animation effects which comes along with Genie (BTW there are lots of other character as well like Merlin, Robbie, Peddy etc., You know what? we can create our own Character as well). Some of the other animations which I used while preparing a diwali greetings are as follows:

1. "Announce, AnnounceReturn"
2. "Explain, ExplainReturn"
3. "Pleased, PleasedReturn"
4. "Suggest, SuggestReturn"
5. "Think, ThinkReturn"
6. "Process, ProcessReturn"
7. "DoMagic1, DoMagic1Return"
8. "Wave, WaveReturn"

The complete list of possible animations of Genie is here. For creating your own character check this.

But when I was developing the application I wasn't aware about these links, so I downloaded the Character (Genie) and referenced it in a Visual Basic application and from it I got all the animation effects :) If anyone needs that diwali greetings which I developed using this Agent control do get in touch with me.

No comments: