Debugging a Flash Movie Remotely


You can debug a Flash movie file (.swf) using the stand-alone, ActiveX, or plug-in versions of the Debug version of Flash Player 8. Debugging your file remotely is very useful if you have a Flash movie that references server-side scripts on your production server that only run properly when your Flash movie is running on the same server.

On the CD-ROM 

You can find the debugging_code.fla file in the ch32 folder of this book's CD-ROM. Make a copy of this file on a location on your hard drive.

Note 

You need a Web server to use this feature of the Debugger panel. If you have a Web server on your local machine, you can test your files there. Otherwise, you need to upload your files to a remote Web server.

Follow these steps to enable remote debugging and debug the example Flash movie file (.swf):

  1. Open Flash and open the debugging_code.fla document.

  2. Open the Publish Settings by choosing File Publish Settings.

  3. Clear the HTML check box. You can test by directly referencing the Flash movie file (.swf) on your server — you don't necessarily need the HTML document to debug the movie.

  4. Select the Flash tab of Publish Settings and select the Debugging Permitted check box. If you want your Flash movie to be protected from prying eyes, you should enter a password in the Password field. The password will not be hidden in the authoring document. Anyone who has access to the Flash document file (.fla) will be able to view the password.

  5. Press the Publish button in the Publish Settings dialog box. This creates a Flash movie file (.swf) with debugging enabled. Flash also generates a Flash debug file (.swd). The Debug version of Flash Player uses this file when remotely debugging a movie. Both of these files should be uploaded to the same directory of your Web server.

    Note 

    If you do not upload the .swd file, you can still debug remotely. However, you will not be able to step through the code, because breakpoints will be ignored.

  6. Press OK to close the Publish Settings.

  7. Open the Debugger panel by choosing Window Debugger.

  8. Enable Remote Debugging in Flash 8 by selecting Enable Remote Debugging from the Debugger panel's options menu. You have now finished all the steps needed to remotely debug the Flash movie.

  9. Upload the Flash movie file (.swf) and debug file (.swd) to your Web server.

  10. Make sure Flash 8 is open. Without Flash 8 open, you will not be able to debug the movie.

  11. In your preferred Web browser, open the remote Flash movie file (.swf). You must make sure the Debug release of Flash Player 8 is installed in the browser you choose. See the "Using the Debug Version of Flash Player 8" sidebar later in this chapter.

    image from book
    Using the Debug Version of Flash Player 8

    Two versions of Flash Player 8 ship with Flash 8: the Debug version and the release version. When you enter the Debug Mode of Flash 8 by choosing Control Debug Movie, the debugging features of the Flash Player 8 are used.

    In order to debug a remote .swf file, you need to use the debug version of Flash Player for your browser. You will find it in the following directory: <Flash 8 program directory>\Players\Debug. Run the appropriate installer for your preferred browser.

    In <Flash 8 program directory>\Players\Release, you will find the Release version of Flash Player 8. You can reinstall the original plug-in (without the debugging features) at any time.

    Periodically, Macromedia may release updates to both the Debug and Release versions of the Flash Player. Check www.macromedia.com/support/flash for updates.

    image from book

  12. The Remote Debug dialog box will open as soon as the Flash movie loads into the browser (see Figure 32-9).

    Caution 

    If the Remote Debug dialog box doesn't open, it means that the Debug release of Flash Player 8 can't find the .swd file. You can still remotely debug your movie, but any breakpoints will be ignored. Right-click (Windows) or Control-click (Mac) any area of the Flash movie's stage and select Debugger from the player's contextual menu.

  13. From the Remote Debug dialog box, select either of the following options:

    • Localhost: Select this option if the Flash 8 authoring application is on the same machine that's running the remote Flash movie in the browser.

    • Other Machine: Select this option if the Flash movie file (.swf) you are debugging and the Flash 8 application aren't on the same machine. In this case, you need to enter the IP address of the machine with the Flash 8 application.

    Tip 

    Don't lose sight of how powerful the "Other Machine" option is during debugging. If a movie is working correctly on your computer but not on an associate's machine, you can have your associate download and install the debug player. When your associate goes to the remote Flash movie in his or her browser, supply the tester with your machine's public IP address in the Other Machine field of the Remote Debug dialog box. Your machine must have Flash 8 running, and it must not be behind a firewall in order for the debugging session to work properly. Note that the tester does not need to have Flash 8.

  14. Once the Flash movie file (.swf) and the Debugger have successfully connected, a password prompt will appear. Enter the password and select OK.

    Note 

    If you didn't enter a password when you published your Flash movie, leave the password field blank and click OK.

  15. You will be automatically taken into Flash 8. You can start debugging just as if the movie was running in Debug Movie mode on your computer. The only difference is that you will need to switch back and forth between the Web browser and Flash 8 to see any visual changes in the Flash movie.

image from book
Figure 32-9: The Remote Debug dialog box as it appears from the browser running the debugged Flash movie

Testing Across Mediums

Macromedia has successfully deployed Flash Player technology over the years. You can now find the Flash Player on many platforms, including Windows, Macintosh, and Linux, but it also exists on devices such as the Pocket PC (PDA handhelds), mobile phones, and the Sony PlayStation.

With the availability of the Flash Player on many platforms and devices, it is very important that you test your Flash movies across all possible mediums. Thoroughly testing your movie on multiple player versions is a crucial step in planning a successful application built with Flash 8. Doing this can save you much trouble further down the road if your application is more successful than you initially planned.

Testing Matrix

Figure 32-10 shows an example of a testing matrix. Such matrices should be used before a launch of any commercial application. Testing across all of these different configurations can be a little time consuming but it ensures maximum compatibility of your application. There is little point to releasing a product that doesn't correctly work for your target audiences.

image from book
Figure 32-10: You could use this matrix for Flash movies that will be viewed and used within a browser. It covers a wide range of available and commercially used browsers.

Regular testing of your product, both at the end of the development and especially during the development cycle, will ensure an easier transition from development to release.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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