Writing Markup for Flash Movie Flash

You learned how to use the new Publish feature, which included automated HTML templates. These templates created the necessary HTML tags to display Flash movies on Web pages. This section discusses the use of Flash movies in your handwritten HTML documents. You can also use this knowledge to alter HTML documents created by the
Publish feature.

Two tags can be used to place Flash movies on a Web page (such as an HTML document): <OBJECT> and <EMBED>. You need to include both of these plug-in tags in HTML documents, as each tag is specific to a browser: <OBJECT> for Internet Explorer on Windows, and <EMBED> for Netscape on Windows and Mac (and Internet Explorer on Mac). Each tag works similarly to the other, with some slight differences in attribute names and organization. Remember that if both sets of tags are included with the HTML, only one set of tags is actually read by the browser, depending on which browser is used to view the Web page. Without these tags, Flash movies cannot be displayed with other HTML elements such as images and text.

Using the <OBJECT> tag
Microsoft Internet Explorer for Windows uses this tag exclusively to enable the Flash ActiveX control. When the Flash Only (Default) HTML template is used in Publish Settings, the HTML document that is published uses the <OBJECT> tag in the following way:

  1. <OBJECT: This is the opening tag containing the ID code and locations of the ActiveX control for Flash. Note that this opening tag includes the attributes lettered B through E.
  2. classid: This lengthy string is the unique ActiveX identification code. If you are inserting the <OBJECT> tag by hand in a text editor, make sure that you copy this ID string exactly.
  3. codebase: Like the codebase attribute of Java <APPLET> tags, this attribute of the <OBJECT> tag specifies the location of the ActiveX control installer as a URL. Notice that the #version=5,0,0,0 portion of the URL indicates that the Flash Player version 5 should be used. You can also specify specific minor releases, such as #version=5,0,29,0, which would install the Flash 5.0 r29 ActiveX control. If the visitor doesn’t have the ActiveX control already installed, then Internet Explorer automatically downloads the control from this URL.
  4. ID: This attribute of the <OBJECT> tag assigns a JavaScript/VBScript identifier to the Flash movie, so that it can be controlled by HTML JavaScript/VBScript functions. By default, this attribute’s value is the name of the actual of .SWF file, without the .SWF extension. Each element on an HTML page should have a unique ID or NAME attribute. The NAME attribute is discussed in the next section.
  5. WIDTH and HEIGHT>: These attributes control the actual width and height of the Flash movie, as it appears on the Web page. If no unit of measurement is specified, then these values are in pixels. If the % character is added to the end of each value, then the attribute adjusts the Flash movie to the corresponding percent of the browser window. For example, if 100 percent was the value for both WIDTH and HEIGHT, then the Flash movie fills the entire browser, except for the browser gutter. See Colin Moock’s tutorial later in this to learn how to minimize this gutter thickness.
  6. <PARAM NAME=movie VALUE=”home.swf”>: This is the first set of <PARAM> subtags within the <OBJECT></OBJECT> tags. Each parameter tag has a unique NAME= setting, not to be confused with JavaScript NAME’s or ID’s. This parameter’s NAME setting movie specifies the filename of the Flash movie as the VALUE attribute.
  7. <PARAM NAME=quality VALUE=high>: This parameter has a NAME attributesetting quality that controls how the Flash movie’s artwork renders within the browser window. The VALUE can be low, autolow, autohigh, high, or best.
  8. Most Flash movies on the Web use the autohigh value, as this forces the Flash Player to try rendering the movie elements antialiased. If the processor of the machine can’t keep up with the Flash movie using antialiased elements, then it turns off antialiasing by switching to a low quality.

  9. <PARAM NAME=bgcolor VALUE=#FFFFFF>: This last parameter name, bgcolor, controls the background color of the Flash movie. If you published an HTML document via the Publish command, then the VALUE is automatically set to the background color specified by the Modify➪Movie command in Flash. However, you can override the Movie setting by entering a different value in this parameter tag. Note that this parameter, like all HTML tags and attributes concerning color, uses hexadecimal code to describe the color.
  10. <PARAM NAME=scale VALUE=noborder>: This optional parameter controls how the Flash movie scales in the window defined by the WIDTH and HEIGHT attributes of the opening <OBJECT> tag. Its value can be showall, noborder, or exactfit. If this entire subtag is omitted, then the Flash Player treats the movie as if the showall default setting was specified. The showall setting fits the Flash movie within the boundaries of the WIDTH and HEIGHT dimensions without any distortion to the original aspect ratio of the Flash movie.
  11. <PARAM NAME=play VALUE=false>: This optional parameter tells the Flash Player whether or not it should start playing the Flash movie as it downloads. If the VALUE equals false, the Flash movie loads in a “paused” state, just as if a “stop” action was placed on the first frame. If the VALUE equals true, Flash starts playing the movie as soon as it starts to stream into the browser.
  12. </OBJECT>: This is the closing tag for the starting <OBJECT> tag. As is shown later in this, you can put other HTML tags between the last <PARAM> tag and the closing </OBJECT> tag for non-ActiveX–enabled browsers, such as Netscape. Because Internet Explorer is the only browser that currently recognizes <OBJECT> tags, other browsers simply skip the <OBJECT> tag (as well as its <PARAM> tags) and only read the tags between the last <PARAM> and </OBJECT> tags.

Using the <EMBED> tag
Netscape Communicator (or Navigator) uses the <EMBED> tag to display nonbrowser native file formats that require a plug-in, such as Macromedia Flash and Shockwave Director or Apple QuickTime.

  1. <EMBED: This is the opening <EMBED> tag. Note that lines B through H are attributes of the opening <EMBED> tag, which is why you won’t see the > character at the end of line A.
  2. src: This stands for “source,” and indicates the filename of the Shockwave Flash movie. This attribute of <EMBED> works exactly like the <PARAM NAME= movie VALUE=”home.swf”> subtag of the <OBJECT> tag.
  3. quality: This attribute controls how the Flash movie’s artwork will display in the browser window. Like the equivalent <PARAM NAME=quality> subtag of the <OBJECT> tag, its value can be low, autolow, autohigh, high, or best.
  4. scale: This attribute of <EMBED> controls how the Flash movie fits within the browser window and/or the dimensions specified by WIDTH and HEIGHT (F).Its value can be showall (default if attribute is omitted), noborder, or exactfit.
  5. play: This attribute controls the playback of the Flash movie. If set to false, the Flash movie does not automatically play until a Flash action tells the movie to play (such as a Flash button or frame action). If set to true, then the Flash movie plays as soon as it starts to stream into the browser.
  6. bgcolor: This setting controls the Flash movie’s background color. Again, this attribute behaves identically to the equivalent <PARAM> subtag of the <OBJECT> tag. See that tag’s description in the previous section.
  7. WIDTH and HEIGHT: These attributes control the dimensions of the Flash movie as it appears on the Web page. Refer to the WIDTH and HEIGHT descriptions of the <OBJECT> tag for more information.
  8. swLiveConnect: This is one attribute that you can’t find in the <OBJECT> tag. This unique tag enables Netscape’s LiveConnect feature, which enables plugins and Java applets to communicate with JavaScript. By default, this attribute is set to false. If it is enabled (for example, the attribute is set to true), the Web page may experience a short delay during loading. The latest versions of Netscape don’t start the Java engine during a browsing session until a Web page containing a Java applet (or a Java-enabled plug-in such as Flash) is loaded. Unless you use FSCommands in your Flash movies, it’s best to leave these attribute set to false.
  9. TYPE=”application/x-shockwave-flash”: This attribute tells Netscape what MIME (Multipurpose Internet Mail Extension) content-type the embedded file is. Each file type (.TIF, .JPG, .GIF, .DOC, .TXT, and so on) has a unique MIME content-type header, describing what its content is. For Flash movies, the content- type is application/x-shockwave-flash. Any program (or operating system) that uses files over the Internet handles MIME content-types according to a reference chart that links each MIME content-type to its appropriate parent application or plug-in. Without this attribute, Netscape may not understand what type of file the Flash movie is. As a result, it may display the broken plug-in icon when the Flash movie downloads to the browser.
  10. PLUGINSPAGE: Literally “plug-in’s page,” this attribute tells Netscape where to go to find the appropriate plug-in installer if it doesn’t have the Flash plug-in already installed. This is not equivalent to a JavaScript-enabled autoinstaller. It simply redirects the browser to the URL of the Web page where the appropriate software can be downloaded.
  11. </EMBED>: This is the closing tag for the original <EMBED> tag in line A. Some older or text-based browsers such as Lynx are incapable of displaying <EMBED> tags. You can insert alternate HTML (such as a static or animated .GIF with the <IMG> tag) between the <EMBED> </EMBED> tags for these browsers.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Flash Topics