April 20, 2001 - Autostarting an SWF | 3
April 20, 2001 Autostarting an SWF Tips: April 2001
Yehuda Shiran, Ph.D.
|
autostart
property tells the Flash player to start the sound immediately after embedding it in the page. In this case you don't need any link to click or mouse over, as the sound will start automatically. As a reminder, in order to sonify your page, follow this recipe:
- Make sure you have the Flash player. 96% of the surfing population already has it. Download.
- Include
flashsound.js
in the HEAD
section.
HEAD
section.
BODY
section.
TGotoAndPlay()
method.
The following two links point to two pages with similar code:
autostart=true
autostart=false
<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
<SCRIPT>
var mySoundObj = new FlashSound();
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT>
mySoundObj.autostart = true;
mySoundObj.embedSWF("theme.swf");
</SCRIPT>
</BODY>
</HTML>
Notice the autostart=true
assignment. You assign instance properties before you embed the SWF file by embedSWF()
. The right link above is the same as the left link, except that the autostart
parameter is false
. Notice that the sound autostarts in the left link, but, in order to start the sound on the right link, you need to mouse over a link.
Here are links you can use to download flashsound.js
and theme.swf
: