Discussion:
Playing Flash in ToolBook Instructor DHTML
(too old to reply)
leh
2004-10-15 15:01:28 UTC
Permalink
I have the following code to play narration which I have stored in Flash.
I created a radio button to toggle the sound on and off. I set a global
variable to s.

The following is the code.

On click...
Set s to s + 1
If s = 1
Execute extPlay() of Shockwave Flash "Flash Control"; discard return value
Else if s = 2
Execute extStop() of Shockwave Flash "Flash Control": discard return value
Set s to 0
End If

It toggles on the sound but does not turn off the sound. What am I doing
wrong? Thank you.
Lee Karns
2004-10-15 16:41:28 UTC
Permalink
try something like this
on Click
If s = 1
Execute extPlay() of Shockwave Flash "Flash Control"; discard return value
Set s to 2
Else if s = 2
Execute extStop() of Shockwave Flash "Flash Control": discard return value
Set s to 1
End If

Since s is a global variable set its initial value to 1 and also reset the
value of it to 1 in an on unload page event.

Lee
-----Original Message-----
From: ToolBook Discussion List
[mailto:***@LISTSERV.PLATTECANYON.COM]On Behalf Of leh
Sent: Friday, October 15, 2004 11:01 AM
To: ***@LISTSERV.PLATTECANYON.COM
Subject: Playing Flash in ToolBook Instructor DHTML


I have the following code to play narration which I have stored in Flash.
I created a radio button to toggle the sound on and off. I set a global
variable to s.

The following is the code.

On click...
Set s to s + 1
If s = 1
Execute extPlay() of Shockwave Flash "Flash Control"; discard return value
Else if s = 2
Execute extStop() of Shockwave Flash "Flash Control": discard return value
Set s to 0
End If

It toggles on the sound but does not turn off the sound. What am I doing
wrong? Thank you.
Laraine Hofmann
2004-10-15 17:10:22 UTC
Permalink
By saving it as 2 separate if statements instead of If...Else if, it then
worked. Go figure...

Loading...