Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Play & Stop Control In Java Script
Category : SWiSH 2 | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

1: Add this code inside the body tags:
QUOTE
<SCRIPT LANGUAGE=\"JAVASCRIPT\">

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
function play_sound() {
   if (n) document.thesound.play(false)
   if (ie) {
       document.thesound.stop()
       document.thesound.play()
   }
}
function stop_sound() {
   document.thesound.stop()
}
</SCRIPT>
<EMBED SRC=\"http://your.host.com/midifile.mid\" HIDDEN=TRUE AUTOSTART=\"false\" MASTERSOUND NAME=\"thesound\">


2. Create a new swish movie and name it whatever you want
3. Create some stop and play buttons, text, etc
4. Insert this in the action of the play button:
QUOTE
 
on [release]
 Goto URL: javascript:play_sound();

5. Insert this in the action of the stop button:
QUOTE

on [release]
 Goto URL: javascript:document.thesound.stop()


The music file can be anything from midi, wav, or an mp3 file. The most interesting part is, it's from and external source and does not use any plugin.

I'll create a web site with the tutorial because the formating doesn't seem right.


All rights reserved - swish-db.com