About Fscommand and Javascript collaboration

Source: Internet
Author: User
Command|javascript

In the Web page, the Flash Player is able to communicate with the browser. You can use Fscommand () to send parameters to the browser in Flash, and then use Movie1_dofscommand () to get the parameters in the browser. MOVIE1 is the ID name of the SWF file that you gave in HTML.

Create a new flash, insert a button

Add as on the button

On (release) {
Fscommand ("Press");
}

· The function is to issue a FS Command named "Press" when the mouse presses the button.
· Then insert it into the Web page, giving it an ID name, such as "jimsons";
· Then add the following code in

<script language= "JAVASCRIPT" >
function Jimsons_dofscommand (Command,args)
The above is typically the format required to invoke the FS command, where "Jimsons" is the ID name of the Flash animation that is inserted into the Web page
{
if (command== "Press")
When FS command= "Press" (The FS command is issued when the button is pressed)
Alert ("Oh, don't touch me!") ");
Pop-up Warning menu, this is a statement that belongs to JavaScript
}
</SCRIPT>
<script language= "VBScript" >
Sub jimsons_fscommand (ByVal command, ByVal args)
Call Jimsons_dofscommand (command, args)
End Sub
</SCRIPT>

Using VBScript, when Flash emits an FS command, execute flash1_dofscommand (command, args);
FLASH1 is the ID of the Flash animation, which is the format that is generally required when using the FS command

Insert flash into the Web page and name its ID number jimsons as follows

<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
Codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
Name= "Jimsons" width= "height=" id= "Jimsons" >
<param name= "movie" value= "http://www.webjx.com/htmldata/2005-10-08/jimsons.swf" >
<param name= "Quality" value= "High" >
<embed src= "http://www.webjx.com/htmldata/2005-10-08/jimsons.swf" width= "," height= "High" quality= "
Pluginspage= "Http://www.macromedia.com/go/getflashplayer"; Type= "Application/x-shockwave-flash"
Name= "Jimsons" ></embed></object>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.