Page 169 - Web Applications (803) Class 12
P. 169

The use of comment tags, which Internet Explorer browsers support, is a far superior and standards-compliant
                 substitute. This technique complies with the W3 standard and promotes uniformity on the Internet.

                    <![if !IE]>
                    <object type=”application/x-shockwave-flash” data=”myfile.swf” width=”400” height=”400”>
                    </object>
                    <![endif]>
                 Embedding Flash in Dreamweaver
                 The procedure of adding Flash to Dreamweaver is rather simple.

                 Click on Insert menu in Dreamweaver → Media → Flash.
                 Let the Flash software generate the embed code.

                 Step 1:  select File > Publish. The  object,  param,  and
                         embed tags will now be created for you by
                         Flash. Additionally, the classid and pluginspage
                         attributes will be added.
                 Step 2:   View the HTML source in the HTML document
                         that Flash prepared and copy the code into the
                         HTML page where you want your Flash movie
                         to appear.

                 Step 3:  Confirm that “myfile.swf” is present in your Web folder.
                 Step 4:  Enter the HTML file’s URL into your browser to view your Flash movie.

                 Using JavaScript Code
                 Flash files can be embedded in HTML using SWFObject. SWFObject is an open-source JavaScript library for
                 embedding Adobe Flash content in web pages and protecting Flash games from piracy, delivered as a small
                 JavaScript file. The library detects the Adobe Flash Player plugin installed in all major web browsers on all
                 major operating systems (OS) and either redirects the visitor to another web page or installs. You can also
                 display alternative HTML content if the included plugin is not suitable.

                 Example:

                    <head>
                    <script type=”text/javascript” src=”swfobject.js”></script>
                    <script type=”text/javascript”>swfobject.embedSWF(‘myfile.swf’, ‘myfile’, ‘500’, ‘450’,
                    ‘9.0.0’);
                    </script>
                    </head>
                    <body>
                       <div id=”myfile”>
                       <p>We’re sorry, your browser does not support Flash 9</p>
                       </div>
                    </body>






                                                    Customising and Embedding Multimedia Components in Web Pages     167
   164   165   166   167   168   169   170   171   172   173   174