Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Flash detection
From: Pascal Tremblay
Date: Fri, 14 Jan 2000 02:13:13 GMT

Well it's a big reply,but here is Colin Mook's tut on detecting flash,I used
it and it works great! :)



DETECTING FLASH 4 WITHOUT SCRIPTING

detecting flash 4 with flash
detecting flash 4 without scripting uses the exact same logic as detecting
flash
2 or 3 without scripting: a hidden movie attempts to redirect the user with
a
get url action; if the user doesn't have flash, then the get url action
never
occurs and the browser will do one of two things: 1) version 4 of netscape
and
ie alert the user that there is flash content and ask the user to go install
the
plugin (a link is provided in netscape while ie performs autoinstallation)
2) in
older browsers, the movie is either ignored or a broken plugin piece may be
shown. to prevent the user from being left on a page with no real content,
we
use a meta refresh to take them to a non-flash page if all else fails. with
the
advent of flash 4, it becomes much more important to address the audience of
users that *do* have flash, but don't have the latest version of the player.
our
flash 4 non-script detection routine provides alternate redirection to flash
3
and flash 2 pages if the flash 4 plugin is not installed. on those pages we
place the appropriate upgrade messages.

here's how it works: we have three get url actions, one for flash 4, one for
flash 3, and one for flash 2. the get url for flash 4 goes to the real site.
the
get urls for flash 3 and 2 go to pages with upgrade information. each get
url is
called using a version-specific feature of flash. we start with flash 4, the
version we most want the user to have. to execute a flash-4 only get url, we
create a normal get url on the main movie timeline, but we set the value of
the
url to an expression. expressions are not interpreted by flash 3 or 2, so
the
get url would be skipped by those players. next we add a flash 3-only
redirection by embedding another get url action in a movie clip. movie clips
are
ignored by flash 2. finally, we place a normal get url on the main movie
timeline which will be executed if flash 2 is installed and the first two
redirects have failed. as a final production task, we place a preloader at
the
beginning of the movie. this ensures that all frames are present before our
redirections are attempted (if we don't add a preloader, the actions are
sometimes skipped over slower connections).

note that the mime type for flash has to be set correctly on your server for
this detection method to work.
how to detect flash 4 (version 1.4)
to detect Flash 4, follow these steps (or skip to the bottom and download
the
sample files):
create a flash movie with 22 frames.
set the movie size to the smallest it can be (18 pixels square).
create an empty keyframe on frames 5, 6, 10, 11, 15, 20 and 22 of the
movie.
on frame 22 of the movie, add a "stop" action. this prevents a problem
with ie
on mac where the browser endlessly loops the movie.
on frame 10 of the movie, add a get url action with a "url" set to the
page
that contains your flash 4 content. then set the "abc" button to
expression
(the two-lines icon). make sure the text in your url is quoted so it is
interpreted as a string, not a variable name. here's an example of what
your
code should look like in the actions listbox:
Get URL ("flash4page.html")
on frame 11 of the movie, you need to add a little actionscript code that
prevents the movie continuing if flash 4 is enabled (otherwise the movie
may
execute the alternate get urls before the f4 url is loaded). we set a
variable
in called f4 to "true" and execute a stop action only if the variable can
be
evaluated to "true" with actionscript. if it can't, we send the movie on
its
way with a play action. here's the code to add:
Set Variable: "f4" = "true"
If (f4 eq "true")
Stop
Else
Play
End If

now you may be wondering why we have to put the play action in the else
statement because it may seem that a stop action in an if statement would
simply be skipped by the flash 3 player. but that's not how it works: the
flash 3 player actually executes the last action found inside an
actionscript
block, so of we didn't add the play action, the movie would simply stop in
flash 3.
create a movie clip with four keyframes.
on frame 2 of the movie clip you just created, add a get url action with a
"url" set to the page that contains your flash 3 content (you put the get
url
is inside the movie clip so that only the flash 3 player will execute the
command, preventing flash 2 users from wrongfully seeing your flash 3
content). note that you can make the upgrade info different for version 3
and
2, but be aware that this version 3 get url is (very) occasionally skipped
in
ie when it attempts to autoinstall version 4.
on frame 3 of the movie clip, add a tell target to tell the main movie
timeline to stop. this prevents the last get url from being executed
before
the flash 3 content has loaded. here's what the tell target looks like:
Begin Tell Target ("/")
Stop
End Tell Target
on frame 4 of the movie clip, add a stop action. this prevents the movie
clip
from looping and repeatedly calling the get url on frame 2.
place your movie clip on the movie stage at the 15th frame of your main
movie
timeline.
on frame 20 of the movie, add a get url action with a "url" set to the
page
that contains your flash 2 content.
next we add the preloader that ensures our get urls will be executed
properly.
on frame 5 of your main movie timeline, add an "if frame is loaded"
action. in
the "number" text field of the "frame" option for your action, enter the
number 22 (we preload our entire movie).
with the line that reads "if frame is loaded (22)" highlighted, add a "go
to"
action. check the "go to and play" checkbox of the "control" option. then,
in
the "number" text field of the "go to" option for your action, enter the
number 7.
to finish the preloader, add a "go to" action on frame 6 of the movie.
check
the "go to and play" checkbox of the "control" option. then, in the
"number"
text field of the "go to" option for your action, enter the number 4.
you're done the movie, now all you have to do is embed it onto an html
page
with a meta refresh set to take the user to a non-flash page after 20
seconds
(perhaps longer if you are hosting your site on a really slow server).
meta tag notes:
here's a sample meta tag:
<META HTTP-EQUIV="Refresh" CONTENT="20;URL=nonflash.html">
you can adjust the amount of time the meta tag waits before taking the
user
to the non-flash page by changing the number "20" in the code above.
remember that on older machines, browsers take 5-10 seconds to load the
flash plug-in.
in netscape, make sure you don't include the "swLiveConnect=true"
parameter
in your movie embed tag, otherwise the browser will pause for 5-20
seconds
while loading java. if your site uses fs command, you should enable
liveconnect on subsequent pages.
there is a strange behaviour on some linux versions of netscape where
the
meta refresh will be executed even after flash has redirected to the
appropriate flash page. to avoid that, you could use javascript's
window.location to redirect instead of meta, but then some users may
have
javascript turned off so they won't get redirected. linux users tend to
be
techies anyway, so it might be best to let them figure out what's
happening
rather than risk losing javascript-disabled users. as with all
detection,
it's just a call you have to make based on your knowledge of your
audience.
whatever the decision though, always have a link to your flash and
non-flash
content somewhere on your pages.
remember to make sure that the colour of your flash movie and your html
document are the same.
also on the html page, make the process feel natural for the user by
adding a
"loading..." message centred in the middle of the screen (using a table).
also, you'll need to explain the upgrade process for Flash 2 & 3 users in
the
alternate flash movies. finally, on your non-flash page, describe how to
get
flash.

hope it helps! ;)

vm


>From: "CHARLES GERSZEWSKI" <c [dot] gerszewskiatnr [dot] cc [dot] mn [dot] us>
>Reply-To: flasheratchinwag [dot] com
>To: flasheratchinwag [dot] com
>Subject: FLASH: Flash detection
>Date: Thu, 13 Jan 2000 16:01:55 -0600
>
>Would anyone be so kind as to give me a primer on flash detection. I have
>a site that has a Flash4 version and an html version and I want to send
>people to the html version if they don't have the Flash4 plugin. I am
>assuming that this is a java script affair.
>
>Thanks in advance
>charlie
>c [dot] gerszewskiatnr [dot] cc [dot] mn [dot] us
>
>
>flasher is generously supported by...
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Streaming Media WEST '99 Conference & Exhibition
> "The Worlds largest Internet Audio & Video Event"
> December 7 - 9, San Jose Convention Center, California
>
>Reserve your space today at http://www.streamingmedia.com
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
>http://www.chinwag.com/flasher or email helpatchinwag [dot] com
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]