Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting Flash 3

Status
Not open for further replies.

inqbus

Programmer
Apr 9, 2001
18
NZ
Hello to all,

The MacroMedia site says you can do this, but how is the question.
How do detect if the browser has the Flash Player loaded/installed, so I can redirect the unfortunate that dont as nessesary.

Thanx 4 ur time
inqbus
 
You're right! Macromedia says it and explains it:
Go to-> Type -> TechNote 4150 in the search box (lower left), and hit GO!
The first item (100%) in the search results will be:
Flash OBJECT and EMBED Tag Syntax

Hit that link and you will see the following:

Flash OBJECT and EMBED Tag Syntax
Product: Flash
Platform: All
Versions: 5.0 and above
ID: 4150

Introduction
An HTML page is required to correctly display a Flash movie in a browser. This HTML page must contain tags that reference the actual Flash movie file to be opened and played. These tags are the OBJECT and EMBED tags. The OBJECT tag is used by Internet Explorer on Windows and the EMBED is used by Netscape Navigator (Macintosh and Windows) and Internet Explorer (Macintosh) to direct the browser to load the Flash Player. Internet Explorer on Windows uses an ActiveX control to play Flash content while all other browser and platform combinations use the Netscape plugin technology to play Flash content. This explains the need for two tags.

Note: hand coding HTML pages with OBJECT and EMBED tags is not necessary when using Flash 4 or later. The Publish feature present in those versions of Flash will automatically create an HTML document that contains the required HTML tags for browsers to access a Flash movie on the web. There are also several different HTML publishing templates to choose from. To use the Publish feature choose File > Publish Settings. For more information on using the feature see the Using Flash manual or online help.

...

Adding <OBJECT> and <EMBED> tags manually
It's simple to create the tags required to display a Flash movie in a browser.

To add OBJECT and EMBED tags manually: 1 Copy the HTML code below and paste it into your HTML.
<OBJECT CLASSID=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; WIDTH=&quot;100&quot;
HEIGHT=&quot;100&quot; CODEBASE=&quot;swflash.cab#version=5,0,0,0&quot;>
<PARAM NAME=&quot;MOVIE&quot; VALUE=&quot;moviename.swf&quot;>
<PARAM NAME=&quot;PLAY&quot; VALUE=&quot;true&quot;>
<PARAM NAME=&quot;LOOP&quot; VALUE=&quot;true&quot;>
<PARAM NAME=&quot;QUALITY&quot; VALUE=&quot;high&quot;>

<EMBED SRC=&quot;moviename.swf&quot; WIDTH=&quot;100&quot; HEIGHT=&quot;100&quot; PLAY=&quot;true&quot;
LOOP=&quot;true&quot; QUALITY=&quot;high&quot;
PLUGINSPAGE=&quot;</EMBED>

</OBJECT>

2 Edit the attributes of the tags for the movie.

Change the HEIGHT and WIDTH parameters to match the height and width of the movie dimensions or use percentage values, if desired.

Change &quot;moviename.swf&quot; where it appears in the OBJECT and EMBED tags to the name of movie to be played.



Why use these all these HTML tags? What do they do?
The OBJECT tag is for Internet Explorer 3.0 or later on Windows 9x/2000/NT platforms or any browser that supports the use of the Flash ActiveX control. The &quot;classid&quot; must appear exactly as it does in this example. The &quot;codebase&quot; attribute must also appear exactly as it does in this example; it tells the browser where to find Flash Player for automatic download. Internet Explorer 3.0 or later on Windows 9x/2000/NT will prompt the user with a dialog asking if they would like to auto-install the Flash Player if it's not already installed. This process can occur without the user having to restart the browser.

The EMBED tag is for Netscape Navigator 2.0 or later, or browsers that support the use of the Netscape-compatible plugin version of Flash Player. The &quot;pluginspage&quot; attribute tells the browser where to direct the user to find Flash Player for download if the Player is not already installed. The user would then need to download and run the installer and restart their browser.

...

This code is the minimum required HTML to provide Flash Player content in your web pages. There are other attributes that you can use in your OBJECT and EMBED tags to help control your movie. To learn more about these review Flash OBJECT and EMBED tag attributes (TechNote 12701).


-----------------------------------------------------------

In other words, if you use PUBLISH (in Flash) to create the necessary html to embed your movie, the user that doesn't have Flash installed, will automatically be redirected, if he so wishes, to the download site.
If you're creating the html yourself, you should include what I've highlighted in red in the above, as Macromedia points out!

;-)

Has Oldnewbie help you out?
If so, let me know!
 
Or you can use flash to detect flash:
Make a tiny movie, and in the first frame, put in a redirection to the page which contains your actual movie, and add a meta refresh to the html page containing this tiny movie and set it to 5 seconds to redirect to another page telling the user they don't have flash.

When someone with flash goes to the tiny movie page, the movie will load and redirect them to the flash site. When someone without flash goes to the page, the flash movie can't load, so it does nothing, but the meta refresh tag will redirect them to a page telling them they need flash and how to get it.
 
Tidgel,
Pourquoi faire simple... Quand on peut faire compliqué!

;-)
 
hi,
if you want to detect if the ShockwaveFlash is installed or
not with VBScript, try this...

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Dim FLASH

SUB Window_OnLoad()
FLASH = &quot;UNKNOWN&quot;

FindFlash()

IF FLASH = &quot;NOT INSTALLED&quot; THEN
your not installed code
ELSE
your installed code
END IF
END SUB

SUB FindFlash()
On Error Resume Next

IF NOT (IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash&quot;))) THEN
'*** REALLY DO NOTHING ***
ELSE
FLASH = &quot;INSTALLED&quot;
END IF

IF FLASH = &quot;UNKNOWN&quot; THEN
FLASH = &quot;NOT INSTALLED&quot;
END IF
END SUB
</SCRIPT>
 
SRGB... 7 months old thread!

Regards,
new.gif
 
Hey srgb,
Thanks for that, sounds good. I have used java, but I would prefer to use VB. I'll give it a go.
Thanks heaps.
 
I noticed the VB example above...and I currently have the 'typical' Flash code in my html pages, but is there a way in javascript to do the following:

javascript code to detect Flash
if found:
display menubar.swf (using the code with object and embec)
else:
javascript code for javascript menubar
end code

On some pages I have a javascript menubar that I use. I'd like to move to a Flash menu bar that I started using a little while back. I'm not a programmer so I don't know how to write the if/then detect script. Any help you can give would be greatly appreciated.

Thanks,
Bruce :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top