May 5, 2001 - Suppressing Error Messages
May 5, 2001 Suppressing Error Messages Tips: May 2001
Yehuda Shiran, Ph.D.
|
FlashSound JavaScript API lets you choose whether to suppress error message or not, with the muteErrorMsg
property of the FlashSound
object. Notice the double negative here. In order to suppress error message, you need to set this property to false
. Set it to true
during the debugging phase. The default setting is true
, i.e. error messages are suppressed by default.
As a reminder, in order to sonify your page, follow this recipe:
flashsound.js
in the HEAD
section. Download.
HEAD
section.
BODY
section.
onmouseover
event handler to the TGotoAndPlay()
method.
The following JavaScript code include an error, because the variable a
is not defined:
<SCRIPT LANGUAGE="JavaScript">
FlashSound.muteErrorMsg = a;
</SCRIPT>
We can choose to get or suppress an error message for this JavaScript error. The following script will suppress the error:
<SCRIPT LANGUAGE="JavaScript">
FlashSound.muteErrorMsg = true;
FlashSound.muteErrorMsg = a;
</SCRIPT>
And the following script will reveal the error:
<SCRIPT LANGUAGE="JavaScript">
FlashSound.muteErrorMsg = false;
FlashSound.muteErrorMsg = a;
</SCRIPT>
Click the following two links to see a demo for each of these two file:
Here is the source code for the file that reveals the error:
<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
FlashSound.muteErrorMsg = false;
FlashSound.muteErrorMsg = a;
</SCRIPT>
</BODY>
</HTML>
And here is the source code for the file that suppress the error:
<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
FlashSound.muteErrorMsg = true;
FlashSound.muteErrorMsg = a;
</SCRIPT>
</BODY>
</HTML>
Here is a link you can use to download flashsound.js
.