Diff for /books/www/chapters/ch05.html between versions 1.13 and 1.14

version 1.13, 2002/12/11 19:10:24 version 1.14, 2002/12/14 14:12:15
Line 1271  retval=OK; Line 1271  retval=OK;
     Mozilla instantiates a Mozilla sound component and plays a      Mozilla instantiates a Mozilla sound component and plays a
     sound with it. Go ahead and try it. Example 5-11<a name=      sound with it. Go ahead and try it. Example 5-11<a name=
     "77032"></a> <i>Scripting components from HTML</i></p>      "77032"></a> <i>Scripting components from HTML</i></p>
<pre><xmp>
 &lt;html&gt;<html>
 &lt;head&gt; <head>
 &lt;title&gt;Sound Service Play Example&lt;/title&gt;   <title>Sound Service Play Example</title>
 &lt;/head&gt;   <script>
 &lt;body&gt;     function play() {
 &lt;script&gt;       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");       var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance();
   var url = Components.classes&lt;/td&gt;["@mozilla.org/network/standard-       url = url.QueryInterface(Components.interfaces.nsIURL);
       url;1"].createInstance( );       url.spec = "resource:/res/samples/test.wav";
   url = url.QueryInterface(Components.interfaces.nsIURL);       var sample = Components.classes["@mozilla.org/sound;1"].createInstance();
   url.spec = "resource:/res/samples/test.wav";       sample = sample.QueryInterface(Components.interfaces.nsISound);
   var sample = Components.classes&lt;/td&gt;["@mozilla.org/sound;1"].createInstance( );       sample.playSystemSound('resource:/res/samples/test.wav');
   sample = sample.QueryInterface(Components.interfaces.nsISound);    }
 &lt;/script&gt;   </script>
 &lt;form name="form"&gt; </head>
   &lt;input type="button" value="Play Sound" onclick="sample.play(url);"&gt; <body>
 &lt;form&gt; <form name="form">
 &lt;/body&gt;   <input type="button" value="Play Sound" onclick="play();">
 &lt;/html&gt; <form>
</pre> </body>
  </html>
 </xmp>
     <p>As in <a href="#77030">Example 5-10</a>, the classes[ ]      <p>As in <a href="#77030">Example 5-10</a>, the classes[ ]
     array on the special Mozilla <tt>Components</tt> object refers      array on the special Mozilla <tt>Components</tt> object refers
     to a particular component-in this case, the <tt>sound</tt>      to a particular component-in this case, the <tt>sound</tt>

Removed from v.1.13  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>