Flash Player in the Web page commonly used parameter settings _ Application Tips

Source: Internet
Author: User
We now most people do Web pages, are directly in the DW into Flash, and DW is WYSIWYG, directly generated the corresponding flash display code. But how many people do we know about the code that is generated directly from DW? In fact, I contacted the Flash Player tag, when I was just learning html, when the book inserted flash only the simplest <embed src= "width=" "height=" "></embed>", And for a long time, as long as the Web page inserted in the flash I also write, at that time, I think that this writing is easy to remember, and save the code, but to the DW to ask why such a simple code, it should be so complicated. But think carefully, DW generated code must have his reason. And in the later application, also should testify my judgment (hehe, perhaps the idea is originally on the dish).
These weeks, has been doing flash and JS and. NET interaction-related applications, so the object, embed tags have a deeper understanding. On these two days, in the implementation of the Flash Web page trailer layout function (similar to the QQ space of JS layout), due to different users, load and output different user profiles, so I thought of by. NET generates the corresponding user's profile name, and uses <param name= "Flashvars" value= "Import=userimport1.txt&output=useroutput1.txt" > To pass the relevant file variables to flash. However, in practical applications, it is found that browsers such as Firefox and opera do not know how to change such variable transmission, or rather, they do not support <param> tags. So today's time, on the MM network collection integration of the relevant content.

First, Introduction:
We want to display the Flash content normally in the Web page, then the page must have a label that specifies the flash path. Which is the object and the embed label. The object label is used for the Windows platform's IE browser, and embed is for the Netscape Navigator browser under Windows and Macintosh platforms and IE browsers under the Macintosh platform. The Windows platform's IE uses ActiveX controls to play Flash while other browsers use Netscape plug-in technology to play Flash.

Here is a simple code example for inserting flash in a Web page:

Code:


<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
Codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
Width= "height=" id= "Mymoviename" >
<param name=movie value= "myflashmovie.swf" >
<param name=quality value=high>
<param Name=bgcolor value= #FFFFFF >
<embed src= "/support/flash/ts/documents/myflashmovie.swf" Quality=high bgcolor= #FFFFFF WIDTH= "HEIGHT=" "400"
Name= "Mymoviename" align= "" Type= "Application/x-shockwave-flash"
Pluginspage= "Http://www.macromedia.com/go/getflashplayer" >
</EMBED>
</OBJECT>
Second, why use all of the above labels? Can you omit some labels?
The object label is for Windows IE3.0 and later browsers or other browsers that support ActiveX controls. The "ClassID" and "codebase" properties must be written exactly as shown in the example above, and they tell the browser to automatically download the Flash Player's address. If you have not installed Flash Player then IE3.0 Browser will jump out of a prompt to see if you want to automatically install Flash Player. Of course, if you don't want users who don't have Flash Player installed to download the player automatically, maybe you can omit the code.

The embed tag is for Netscape Navigator2.0 and later browsers or other browsers that support Netscape Plug-ins. The "pluginspage" property tells the browser to download Flash Player's address, and if Flash Player is not installed, the user will need to restart the browser before it can be used properly.
To make sure that most browsers display flash correctly, you need to nest the embed tags inside the object tag, just like the code example above. Browsers that support ActiveX controls will ignore the embed label in the object label. Netscape and the IE browser using plug-ins will read only the embed tag and will not recognize the object label. In other words, if you omit the embed tag, Firefox will not be able to identify your flash (but wonder, omitted the object only write Embed,ie can also be normal display of flash, hehe, concrete and carefully look again).
This article lists the necessary and optional attributes for publishing the object and embed labels for the movie.

First, required attributes:
· classid-sets the browser's ActiveX control for the object label only.
· codebase-sets the location of the Flash ActiveX control, so you can download the installation automatically if the browser is not installed. For object labels only.
· width-Specifies the width of the Flash movie as a percentage or pixel.
· height-Specifies the height of the Flash movie as a percentage or pixel.
· src-Specifies the download address for the movie. For embed labels only.
· pluginspage-sets the location of the Flash plug-in, so if the browser is not installed, you can automatically download the installation. For embed labels only.
· movie-Specifies the download address for the movie. For object labels only.

Second, optional attributes and available values:
· id-Set variable name for scripting code references. For object only.
name-Sets the variable name for a reference to scripting code such as JavaScript. For embed only.
· Swliveconnect-(TRUE or FALSE) Specifies whether Java is enabled when Flash Player downloads for the first time. If some properties are omitted, the default value is False. You have to work with Fscommand to use JavaScript and Flash,java on the same page.
· Play-(TRUE or FALSE) specifies whether the Flash movie is played automatically after the download completes, and if this property is omitted, the default is true.
· Loop-(TRUE or FALSE) specifies whether the movie stops or continues looping after the last frame is played, and defaults to true if this property is omitted.
· MENU-(True or false)
· True displays all menus, allowing users to zoom in, zoom out, and so on to control movie playback.
· False displays only the Settings option and the menu about flash.
· QUALITY-(Low, High, Autolow, Autohigh, best)
· Low speeds are superior to aesthetics and do not apply anti-aliasing.
· Autolow is just beginning to focus on speed, but when needed, it can be upgraded at any time.
· Autohigh at the same time focus on the speed and beauty, but the need to sacrifice beauty to ensure playback speed.
· Medium applies some anti-aliasing without smoothing the bitmap. It has a quality higher than the low setting and below the high setting.
· High beauty is better than playback speed, and has been applied anti-aliasing. If the movie contains no animations, the bitmap is smoothed, and if the movie contains animations, the bitmap will not be smoothed.
· Best display quality without regard for playback speed. All output applies anti-aliasing and all bitmaps are smoothed.
· SCALE-(ShowAll, Noborder, Exactfit)
· The Default (show All) movie is displayed in the specified area, but remains in the original proportions. A border will appear on both sides of the movie.
· No boder shrink the movie to fit the specified area, keeping the movie not distorted, but some of the movies will probably trim. However keep the original proportions of the film.
· Exact Fit enables the entire movie to be displayed in the specified area, and the film is likely to distort and not maintain the original proportions.
· ALIGN-(L, T, R, B)
• The default is centered, and when the browser window is smaller than the movie, the edges are trimmed.
· Left,right,top,bottom is aligned along the edge of the browser as appropriate. If necessary, the other three sides will be trimmed.
· Salign-(L, T, R, B, TL, TR, bl, BR)
· L,r,t,b
· Tl,tr
· Bl,br
· wmode-(window, opaque, transparent) sets the window Mode property of the Flash movie to specify the transparency, cascade, and position of Flash in the browser.
· The window movie plays inside its own rectangular window in the browser.
· The Opaque film hides all the content behind it.
· Transparent makes the Flash movie transparent, displaying the contents of the Web page behind the transparent movie. This will degrade the performance of the animation. And this property is not available in all browsers.
· BgColor-(#RRGGBB, hexadecimal RGB value. Specifies the background color of the movie. Use this property to overwrite the background color set in Flash.
· Base-Sets the base directory or URL to solve the relative path in Flash. Similar to the <base> label in the Web page.
· Flashvars Transfer variables to flash Player, Flash PLAYER6 and future versions are required.
• Pass the root-level variable to the movie. The format of the string is a name=value set separated by "&".
• The browser supports a string length of 64kB size.
For more information about Flashvars, please check the relevant documentation.

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.