Home >Web Front-end >JS Tutorial >Pay attention to details when passing parameter values ​​​​to flash swf files using javascript_Basic knowledge

Pay attention to details when passing parameter values ​​​​to flash swf files using javascript_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 17:47:051327browse
Question: How to pass parameters to SWF file using javascript?
I found a complete tutorial on the Internet, which is very inspiring and practical. The following are the complete implementation steps:
Configuring SwfObject:
Swfobject2 is the current detection user Is it the best way to install Flash. It is considered an 'industry standard' and new versions of all Adobe products (Flex 4, Flash CS5) use SwfObject to detect Flash Player.
First download, unzip the ZIP file, and copy the swfobject.js file to your web server. It is a good idea to create a root folder named 'js' in the root directory. (So ​​the file location should be http://myserver.com/js/swfobject.js). We will refer to this file in the HTML files we create later. If you want to use the ExpressInstall feature (to provide users with an easy upgrade method), you must copy expressInstall.swf to the same folder.
Configuration HTML file :
HTML file includes two Javascripts. A parameter used to fetch the URL from. Created by Matt White, this is simple but very effective. The code is as follows:
Copy code The code is as follows:



Place the above code into your HTML in the HEAD tag of the file. You also need to import the SWFObject script, the code is as follows:
Another Javascript is inserted using SwfObject SWF file. You can place it anywhere in your HTML file. The first thing we need to do is create a DIV tag that will prompt the user when the appropriate Flash Player is not installed.
Copy code The code is as follows:


This content requires Flash Player 9 (or a more recent version).

You need to
upgrade your Flash Player



You can enter any content you want within the DIV tag. Add images or feedback as you like, as these will be replaced by the SWF file.
Next is the Javascript to implement the replacement function:
Copy the code The code is as follows: