Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Script to launch on client with click event

Reply
Thread Tools

Script to launch on client with click event

 
 
pmclinn@gmail.com
Guest
Posts: n/a
 
      04-11-2005
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="CLSID45FD31B-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>

 
Reply With Quote
 
 
 
 
pmclinn@gmail.com
Guest
Posts: n/a
 
      04-11-2005
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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When user press F5 after a button click event, the click event fires again! Max2006 ASP .Net 2 09-19-2007 05:37 AM
Wire up a click event within another click event doesn't work... Chu ASP .Net 2 04-10-2006 10:43 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM



Advertisments