Getting Your Movie on the Web

I l @ ve RuBoard

Now that you have published your movie, it's time to put it on the Web. This is a simple but often misunderstood process. You have to make sure to upload all the required files to your Web server, or the Flash Web site won't work. That means that all HTML files and .swf files, including those loaded into other movies, have to be included.

In this exercise you will create an HTML file that opens the zoo.swf file in a pop-up window. Then you will figure out which files need to be uploaded. If you have access to a Web server, you will upload all of the files so you can view your Flash Web site on the Internet!

  1. Copy the index.html, blank.html, and frames .html HTML files from the Lesson12/Assets folder to the FlashTFS folder on your hard drive.

    graphics/12fig31.gif

    If you know JavaScript, you would have no problem creating an HTML file with the code necessary to open a pop-up window. The index.html file looks like this:

      <html>   <head>   <title>ZooMX</title>   <script language="javascript">   <!   --   function launchWin(url, name, winW, winH) {   var winleft = (screen.width- winW) / 2;   var wintop = (screen.height- winH) / 2;   features =   'width='+winW+',height='+winH+',left='+winleft+',top='+wintop;   popup = window.open(url, name, features)   if (parseInt(navigator.appVersion) >= 4) { popup.window.focus(); }   }   // -->   </script>   </head>   <body bgcolor="#FFFFFF"   onLoad="launchWin('frames.html','zoo','600','400');return false; ">   </body>   </html>  

    A copy of index.html, with all the necessary JavaScript, is included in the Lesson12/ Assets folder. Just copy the file to the FlashTFS folder on your hard drive. This file will open the frames.html file, which looks like this:

      <html>   <head>   <title>ZooMX</title>   </head>   <frameset FRAMEBORDER="0" BORDER="0"   FRAMESPACING="0" cols="100%,*">   <frame NAME="top" SRC="zoo.html" FRAMEBORDER="0" BORDER="0"   FRAMESPACING="0" scrolling="no" MARGINWIDTH="0" MARGINHEIGHT="0" >   <frame NAME="bottom" SRC="blank.html" FRAMEBORDER="0" BORDER="0" FRAMESPACING="0" scrolling="no">   <noframes>   </noframes>   </frameset>   </html>  

    graphics/12fig32.gif

    This file opens blank.html and zoo.html in a frame set. The blank.html file is just an empty HTML file, while zoo.html has all of the HTML required to open zoo.swf in the browser, as you can see in the figure below.

    graphics/12fig33.gif

  2. Make sure you have all the necessary files for the ZooMX Web site in your FlashTFS folder. If you're missing any files, you can find a copy in the Lesson12/Completed folder on the CD-ROM.

    You need to make sure you have the following files in the FlashTFS folder on your hard drive: index.html, frames.html, blank.html, zoo.html, zoo.swf, main.swf, top.swf, feature.swf, visitorinfo.swf, map.swf, and guestbook.swf.

    NOTE>

    While there's a games item listed in the menu for the Web site, you didn't make the games .swf file during the course of this book.

    If you can't find one of the files listed, be sure to copy the missing file to the FlashTFS folder from the Lesson12/Completed folder on the CD-ROM.

  3. Upload index.html, frames.html, blank.html, zoo.html, zoo.swf, main.swf, top.swf, feature.swf, visitorinfo.swf, map.swf, and guestbook.swf to your Web site, and browse to index.html.

    graphics/12fig34.gif

    You can't just upload the HTML files and expect to see the Flash content; you have to upload the .swf files, too. The HTML file is set up so that the .swf files should be in the same directory. If you know a little HTML, you can easily change this setup.

    NOTE

    You do not have to upload any. fla files. Those are the editable filesthe .swf files are the ones that Flash compresses for use on the Web.

    If you try to use the dynamic aspects of the map in your uploaded version, it probably won't work, because the PHP file you're trying to connect to is on another domain. Because of security measures in the Flash Player, you won't be able to connect to that file.

    You're done! You have just created your Flash Web site.

I l @ ve RuBoard


Macromedia Flash MX. Training from the Source
Macromedia Flash MX: Training from the Source
ISBN: 0201794829
EAN: 2147483647
Year: 2002
Pages: 115
Authors: Chrissy Rey

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net