Can an SWF streamed file be run automatically?

  gazmania 22:29 21 Feb 2004

Hello all. I am a novice on this sort of thing. I want to run a tune automaticallly when my web page is opened. I've converted the file to SWF in order to stream it. I think it has to be linked with a shockwave link but i'm not sure. Can any experts out therer tell me how to do it?

  Taran 01:48 22 Feb 2004

Audio on web pages is one of my biggest pet hates. Not everyone has a fast web connection and many people keep their speakers either low or off. Now that I've said that, here we go:

A Flash file can be set to play on load, but it is not the ideal may of delivering web audio. About the best overall method is to save your audio file[s] as midi files which give pretty good sound quality and relatively small file sizes, then embed them into your page source code as follows:

<bgsound src="location of the file in your web folder on the web server" autostart="true" loop="1">

The loop="1" means it will play only once then stop and the autostart="true" is pretty obvious.

<bgsound src="location of the file in your web folder on the web server" autostart="true" loop="-1">

This one has a different integer applied to the loop instruction. You can either use any positive number: 1 plays a sound once, 2 plays it twice and so on, or you can set the loop to ="true" or ="false". Setting it to a negative number as in loop="-1" is the same as typing the word infinite. It will loop the sound until the page has been left.

<embed src=""> is another method of putting soundfiles into your web pages.

Now, Internet Explorer likes the <bgsound> tag and NetScape likes the <embed> tag.

There are ways of scripting an "if, else" statement into your page so that if Internet Explorer is detected your soundfile launches using <bgsound> else if NetScape is detected the sound will play using the <embed> tag.

I'm not going to go through all of that since it is, frankly, far more work than it is worth and most alternative browsers like Opera, FireFox [formerly FireBird] and similar have the ability for the user to re-set the browser to tell the web server that it is something it is not - in simple terms you can get these browsers to declare themselves as different versions of Internet Explorer or one of the Mozilla/NetScape variants.

If you must use a flash file then you embed the code for it like this:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="click here" >

<param name="movie" value="filename.swf">

<param name="quality" value="high">

<embed src="filename.swf" quality="high" pluginspage="click here" type="application/x-shockwave-flash" >



I've missed out some of the code you can include like heights and widths if you want to display your flash file with visible image properties, loop instructions, autoplay instructions and so on.

Note that parts of the code will turn into blue "click here" hyperlinks because they are the web addresses in hyperlinks for people to download the necessary ShockwaveFlash plugin to play the file if they don't already have it installed. If you copy the code into NotePad it will render properly without changing parts of it into visible links.

So much depends on how you want your sound to start and how many times you want it to play.

Like I said above, it's far more work than it's worth and I advise strongly that you forget the whole idea.

  gazmania 11:03 22 Feb 2004

With your guidance I have managed to compile a streaming sound web page (using an swf file). My aim is to get the music to play automatically on load, but I can't get that to work. Things to note here are:
1) height and width, I don't need them, do I simply omit?
2) autostart doesn't work. Should I use "autoplay"? I did try that earlier without success.
3) "Hidden" seems to have no effect.
4) My music, "ebay.SWF" is on a server as you can see when you hover over the "click here".
5) As it is, I get a "play button" which, when clicked, plays the music, so I do have some success thank to your help.

Any further advice would be appreciated.

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width = "100"
height = "100"

CODEBASE="click here">
<PARAM NAME="MOVIE" VALUE="click here">
<PARAM NAME="autostart" VALUE="true">
<PARAM NAME="hidden" VALUE="high">

<EMBED SRC="ebay.swf" WIDTH="100" HEIGHT="100" PLAY="true"
LOOP="true" QUALITY="high"
PLUGINSPAGE="click here= ShockwaveFlash">


  Taran 12:04 22 Feb 2004

It would help to know the software you are using the generate your movie file and web page[s].

General instructions for Flash can be found here:

click here

A demo of embed tags and similar:

click here

In the last line of your code, adding loop="false" and play="false" will prevent the file from playing automatically and repeating, like this:

<embed src="name and location of sourcefile.swf" width="466" height="277" loop="false" play="false" quality="high" pluginspage="click here" type="application/x-shockwave-flash">

<embed src="name and location of sourcefile.swf" width="466" height="277" quality="high" pluginspage="click here" type="application/x-shockwave-flash">

As I first mentioned the height and width attributes are for visuals. Embedding midi files is so much simpler...

If you tell us which software you are using to design your site it may help, since most editors feature built it tools for the common attributes of Flash movie files in web pages.

  Taran 12:05 22 Feb 2004

That second line, without the loop="false" and play="false" tags, was meant to show the differences and will autoplay and loop a movie file by default.

  gazmania 12:38 22 Feb 2004

i'm using Frontpage. I'm trying to get the music to start automatically upon load without the need to click on anything first. The reason for using SWF is because the source file (MP3) is over 1mb. The SWF will stream the music through at a reasonable speed. Does this mean then that I should omit the Loop and Play tags altogether?
Sorry if I'm sounding thick here.

  Taran 12:58 22 Feb 2004

FrontPage uses a different system.

It puts these tags in:

<embed width="128" height="128" src="name and location of sourcefile.swf">

<noembed>Your browser does not have the necessary plugin to support this file</noembed>

There are no built in controls necessary to get the movie to autoplay since unless you set a play="false" tag into your code it should launch the file on load.

I still say that a midi file is your best bet. Midi is normally smaller than Flash with better audio quality and is dead easy to embed. I think you're making things more difficult thatn they need to be and I would repeat my dislike for audio on the web to begin with.

Most people do not like audio on web pages. Even if you get your file sizes down by quite some margin visitors dislike having to wait for the file to load, especially over 56k dial up modems, most people also like the option on whether to hear the music or not, since what one person likes or thinks is good others may detest and so you need to have an on/off control.

Some simple "how to" article for FrontPage and Flash is:

click here

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

8 brilliant character artists speaking at Pictoplasma 2018

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?