SWFObject Flash js calling class_javascript skills
SWFObject is a Javascript-based Flash media version detection and embedding module. Its main purpose is to make it easier for us to embed FLASH into web pages. It adds a version detection function, conforms to XHTML standard verification insertion, and removes IE's FLASH click activation restrictions are compatible with mainstream browsers.
First let us look at a piece of code that works with SWFObject:
//Load the SWFObject class library
//Set a DIV and set the ID. This DIV will be inserted as FLASH Container
//Use SWFObject to insert FLASH
What do you think after reading the above code? Compared with usual use of Object to insert FLASH files, is it much simpler, and the code structure is clearer? For the Chinese explanation of this code, please refer to AW's translation of SWFObject. It is already very detailed, so I won't go into details. I will only introduce myself below. Considered the most practical function.
1. Version detection
It is inevitable that there will be users whose player version is too low, and most of them are low-end users with little knowledge of computers. If they cannot see what we have pointed out FLASH animation, or because the player version does not support certain features in the new version, and the user sees incomplete animation, then this is a bad user experience, and users can easily blame all factors on product development. who. Practical SWFObject can avoid this trouble very well. When it detects that the user's player version is lower than the version we set, FLASH will not replace the content in the DIV container, so we can give the user a prompt here, for example: "You need to upgrade the FLASH player version to 8.0." If conditions permit, we can give users an upgrade link for Adobe's Flash Player here or directly provide an Active installation package for users to download and install.
2. Support for FlashVars
so.addVariable("arg1","test1"));
so.addVariable("arg2","test2"));
The above two lines of code will add two variables arg1=test1, arg2=test2 to the ROOT of FLASH in the form of FlashVars, which is simple and convenient. At the same time, we do not need to consider the compatibility issue of IE and FF.
Note: The communication between JS and FLASH is passed in string, so type conversion is required for the FLASH side of Number type variables.
3. Set FLASH inline parameters
so.addParam("wmode", "transparent");
This is the code we are familiar with to set FLASH background transparency, other inline parameters You can try setting the connection properties.
4. Get the variables in the URL
For URLs that use GET to pass variables like url?arg1=test1&arg2=test2, we can use the getQueryParamValue method to get the variables.
var t1 = getQueryParamValue("arg1"); alert(t1); Official address: <script></script>http://blog.deconcept.com/swfobject/<script> var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699"); <BR>//将id为flashcontent的DIV中内容替换为FLASH <BR>so.write("flashcontent"); <BR></script>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Article discusses creating, publishing, and maintaining JavaScript libraries, focusing on planning, development, testing, documentation, and promotion strategies.

The article discusses strategies for optimizing JavaScript performance in browsers, focusing on reducing execution time and minimizing impact on page load speed.

Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

The article discusses effective JavaScript debugging using browser developer tools, focusing on setting breakpoints, using the console, and analyzing performance.

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

The article explains how to use source maps to debug minified JavaScript by mapping it back to the original code. It discusses enabling source maps, setting breakpoints, and using tools like Chrome DevTools and Webpack.

This tutorial will explain how to create pie, ring, and bubble charts using Chart.js. Previously, we have learned four chart types of Chart.js: line chart and bar chart (tutorial 2), as well as radar chart and polar region chart (tutorial 3). Create pie and ring charts Pie charts and ring charts are ideal for showing the proportions of a whole that is divided into different parts. For example, a pie chart can be used to show the percentage of male lions, female lions and young lions in a safari, or the percentage of votes that different candidates receive in the election. Pie charts are only suitable for comparing single parameters or datasets. It should be noted that the pie chart cannot draw entities with zero value because the angle of the fan in the pie chart depends on the numerical size of the data point. This means any entity with zero proportion

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...
