Whilst we wait with anticipation to Swish V2 with it's FS Command capability, I thought I should remind everyone of the power of JavaScript with SWF's.

You can easily PLAY / STOP, Check movie loaded, ZOOM, jump frames and so on with a bit of scripting.
This allows you to communicate with your movies from your web page and control a movie outside of itself.
For example, simple text of GIF buttons elsewhere on the page could give reactions to your movie.
I find these features underused, there is a lot of potential in these features if you stop and think of what you can do.

An example of these features being used on site is at http://www.williamorbit.com, when in the site, when you press a navigation button (left side), it changes the SWF frame in the movie top-left of the site - I use many others in a more complicated way elsewhere.

A quick list of JS commands with SWF are as follows:

Play() - Start playing the animation.
StopPlay() - Stop playing the animation.
IsPlaying() - Returns true if the movie is currently playing.
GotoFrame (int frameNum) - Goto a specific frame of the movie. (i.e. GotoFrame(200) )
TotalFrames() - Returns the total number of frames in the movie.
Rewind() - Go to the first frame.
SetZoomRect (int left, int top, int right, int bottom) - Zoom in on a rectangular area of the movie.
Zoom(int percent) - Zoom the view by a relative scale factor. (i.e. Zoom(50) for 50%)
Pan (int x, int y, int mode) - Pan a zoomed in movie. The mode can be: 0 = pixels, 1 = % of window.
PercentLoaded() - Returns the percent of the .swf file that has streamed in to the browser so far ranges (0-100).

In this example below, assume the SWF stops at frame 10 because you've told it to in SWISH.
But the JavaScript function below will cause the movie to move into frame 25 when the function is called either by an action/mouseover etc etc.

// the JavaScript Stuff (have this in the <head> section of your HTML)

<script Language="JavaScript">
function Jump(){
if (document.MySWF.PercentLoaded() == 100){
<BODY BGCOLOR="#ffffff" TEXT="#000000" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 rightmargin=0 id=all>

// In your your EMBED and OBJECT tags, add ID="MySWF" (see below)

<OBJECT CLASSID="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
<PARAM NAME="Movie" VALUE="my.swf">

<a href="JavaScript:Jump();">Click here to jump to frame 25</a>


Please don't ask me any more questions right now, have a play with it yourself ... it's the best way to learn!

For more information see http://www.macromedia.com/support/fl...ts/tn4160.html

Richard Shea.