Flash Templates

Flash Templates Today
Web Sites
Free Shape
Photoshop Tutorials
Flash Tutorials

Free Website Templates
View All Templates!
Preview & Download
Preview & Download
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Free Website Templates: 123456789101112131415
Preview & Download Preview & Download Preview & Download

Welcome To MyFreeWebTemplates.info Flash Tutorials Area - Use FSCommand to quit the browser

SYMPTOMS

FScommand doesn't work when the movie plays in a browser. FScommand works only with Macromedia standalone projector.

This tutorial describes how to create a "quit button" and use fscommand to communicate with the browser

Example of fscommand:quit

SOLUTION

Step 1:

Add the following JavaScript handler to your HTML page:

<SCRIPT LANGUAGE=JavaScript>
<!--

function flashMovie_DoFSCommand(command, args) {

  if (command == "quit")
  {
    window.opener=self;window.close();
  }

}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
<!-- 
Sub flashMovie_FSCommand(ByVal command, ByVal args)
  call flashMovie_DoFSCommand(command, args)
end sub
}
//-->
</SCRIPT>

Step 2:

Open your Flash Designer project and program the button. Select the button and choose "Item" > "Actions" > "OnClick". To execute FScommand use one of the following methods:


Get URL option


ActionScript option

Step 3:

Export SWF file with "File" > "Export Flash SWF File" command. Choose "File" > "View HTML Code" copy the code and paste it to your HTML page.

Modify the code and add ID (flashMovie) to the OBJECT and EMBED tags and swfliveconnect option to EMBED:

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="flashMovie"
WIDTH="640" HEIGHT="480"
CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
<PARAM NAME="MOVIE" VALUE="flash.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="true">
<PARAM NAME="WMODE" VALUE="opaque">
<PARAM NAME="QUALITY" VALUE="high">
<EMBED SRC="flash.swf" WIDTH="640" HEIGHT="480" PLAY="true" LOOP="true" 
WMODE="opaque" NAME="flashMovie" QUALITY="high" swliveconnect=true 
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>

NOTE:

In xxxxx_DoFSCommand(command, args) handler "command" will be the string after FSCommand: and "args" is the target argument

Download source project t1041.zip (9 kb)

Creating "Close" button

  1. Choose "Frame" > Inset Symbol" command
  2. Choose the following symbol from "Wingding" list:

  3. Choose "Item" > "Actions" > "OnClick"
  4. Choose "Get URL" action and enter the code:

    FSCommand:quit

    Click OK

  5. Choose "Item" > "Actions" > "On Over Color", uncheck "No Color" and select your favorite color, click OK

NOTE: The button will work in HTML page only. It doesn't work in preview mode because there is no javascript code to communicate with.


Illustrator Tutorials
HTML Tutorials
Flash Templates
Free Web Templates
Free Website Templates
Free Flash Templates
Web Templates Forum
Welcome to MyFreeWebTemplates.info we have a collection of Free Templates available for download created by designers from around the globe. Our collection is growing daily so be sure to check back often for more Free Templates. If you can't find a Free Template that suits your needs, we may offer you many professional web templates and flash web templates.

Website templates are pre-made website designs that you can customize and personalize to suit your company's image.You can save time and money by using website templates for your design project.
All Rights Reserved 2007-2008 by MyFreeWebTemplates.info