473,503 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script to launch on client with click event

The code below is generated by an application that allows you to put a
Microsoft assistant on a webpage. I'm having a heck of a time trying
to get this script to launch on a server side button click though.

I want my user to click on a button to launch this script. I have
tried adding the object code to the html directly and then creating a
client on click event with no luck.

I eventually want to dynamically update the text that will be spoken
but for right now all I need help with is getting a script to work on a
server side button click.

Thanks for any help you can give me....
<HTML>
<HEAD>
<TITLE>My Web Store</TITLE>

<!-- Start of WebSpeak VB Script -->
<!-- This script is created using WebSpeak -->
<!-- Download Free Trial From: -->
<!-- http://www.shadisoft.com/webspeak -->

<OBJECT ID="Agent" width=0 height=0
CLASSID="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
CODEBASE="#VERSION=2,0,0,0">
</OBJECT>
<OBJECT width=0 height=0
CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
CODEBASE="#VERSION=6,0,0,0">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Dim C
Dim URLReq
Dim ShowAnimReq

Sub Window_OnLoad()
LoadCharacter
End Sub

Sub LoadCharacter()
Dim Req

On Error Resume Next

Set Req = Agent.Characters.Load ("Char", "ROBBY.acs")
If Req.Status <> 0 Then
Set URLReq = Agent.Characters.Load("Char",
"http://agent.microsoft.com/agent2/chars/robby/robby.acf")
Else
Set C = Agent.Characters("Char")
Start
End If
End Sub

Sub Agent_RequestComplete(ByVal Request)
Dim Req

If Request = URLReq Then
If Request.Status = 1 Then
'Something to do if the URl load failed.. Busy server
Exit Sub
ElseIf Request.Status = 0 Then
Set C = Agent.Characters("Char")
Set ShowAnimReq = C.Get("state", "showing, speaking,
hiding")
C.Get "animation", "Surprised,StopListening,MoveUp", False
End If
ElseIf Request = ShowAnimReq Then
If Request.Status = 1 Then
'Request to load the Show animation failed. The server may
be busy.
Exit Sub
ElseIf Request.Status = 0 Then
Start
End If
End If
End Sub

Sub Start()

C.Moveto 800, 0
C.Show
C.Play "Surprised"
C.Speak "\pit=130\\spd=157\Hi, welcome to My Web Store!"
C.Play "StopListening"
C.Speak "\pit=130\\spd=157\Please feel free to browse our huge
selection of computer hardware and software. We offer the best prices
on the web, always!"
C.Speak "\pau=1000\"
C.Speak "\chr=""whisper""\\pit=130\\spd=157\For a limited time, I
will offer you free shipping on any order valued at $50.00 or more.
Hurry, this won't last for ever!"
C.Play "MoveUp"
C.Speak "\pit=130\\spd=157\Good Bye!"
C.Hide

End Sub

-->
</SCRIPT>

<!-- End of WebSpeak VB Script -->

<BODY>

<!-- Add your HTML code here -->

</BODY>
</HTML>

Nov 19 '05 #1
1 1729
I was able to get my example to halfway work. I created an html button
that calls on the LoadCharacter sub. However, I have not been able to
update this script dynamically yet. Everytime I try to change this
into a server side script something fails.
<SCRIPT LANGUAGE="VBScript">
<!--
Dim C
Dim URLReq
Dim ShowAnimReq
Sub LoadCharacter()
Dim Req
On Error Resume Next
Set Req = Agent.Characters.Load ("Char", "PEEDY.acs")
If Req.Status <> 0 Then
Set URLReq = Agent.Characters.Load("Char",
"http://agent.microsoft.com/agent2/chars/peedy/peedy.acf")
Else
Set C = Agent.Characters("Char")
Start
End If
End Sub
Sub Agent_RequestComplete(ByVal Request)
Dim Req
If Request = URLReq Then
If Request.Status = 1 Then
'Something to do if the URl load failed.. Busy server
Exit Sub
ElseIf Request.Status = 0 Then
Set C = Agent.Characters("Char")
Set ShowAnimReq = C.Get("state", "showing, speaking,
hiding")
C.Get "animation", "Pleased,Announce,Wave", False
End If
ElseIf Request = ShowAnimReq Then
If Request.Status = 1 Then
'Request to load the Show animation failed. The server may
be busy.
Exit Sub
ElseIf Request.Status = 0 Then
Start
End If
End If
End Sub
Sub Start()
C.Moveto 800, 0
C.Show
C.Play "Pleased"
C.Speak "Hi, welcome to the Eastern Marketing Page!"
C.Play "Announce"
C.Speak "Currently I'm being programmed to summerize the data on
this page!"
C.Speak "\pau=1000\"
C.Speak "\chr=""whisper""\I'm working as fast as I can to finish
this page!"
C.Play "Wave"
C.Speak "Good Bye!"
C.Hide
End Sub
-->
</SCRIPT>

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7745
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
7
1777
by: selen | last post by:
I am using above script for Focus to txtAdi which is textbox in c# web application.But it doesnt work. Have you any idea why it doesnt work thanks....... char c=(char)34;
2
1933
by: adolf garlic | last post by:
I'm having a problem with a button click event being fired erroneously. My login.aspx page has the usual username/password boxes. There is also a link to click when you have filled these, plus a...
34
3284
by: kpg | last post by:
Hello all, I have an asp.net web application with tons of Java script files. I would like to protect the Java Script somehow so it can't be seen by a remote user. I found several 3rd party...
3
1127
by: Morten Wennevik | last post by:
Hi, I need to launch a new browser window while keeping the current window. This must be done server-side and inside the button-click event as parameters etc will be generated there. How can...
0
1820
by: lechatthierry | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
1
1942
by: Neko | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
1
1587
by: =?Utf-8?B?Sm9obkJhdGVz?= | last post by:
Problem: I need to backup and clear the security event log. I have this working via a vbsscript which I will post below. However while I can use this script manually it is not user friendly and...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.