240 likes | 382 Views
Tutorial 7. Creating a Flash Web Site. Structure of a Flash Site. Flash can be used to create a complete Web site in which all of the Web site pages are Flash SWF files and not HTML documents.
E N D
Tutorial 7 Creating a FlashWeb Site
Structure of a Flash Site • Flash can be used to create a complete Web site in which all of the Web site pages are Flash SWF files and not HTML documents. • The SWF files work together based on a navigation system using buttons or other graphic elements that can be clicked to navigate to the various SWF files. • The user should be given the option of which site to view, an HTML version or SWF version. • The SWF files that make up the Web site are referenced from an HTML document. New Perspectives on Macromedia Flash MX 2004
Using Levels • The navigation system for a Flash Web site is simply a set of buttons that, when clicked, cause the Flash Player to play a different part of the current SWF file, or cause a different SWF file to be loaded into the Flash Player. • A SWF file can play on top of another SWF file through the use of levels. New Perspectives on Macromedia Flash MX 2004
Using Levels Main SWF file New Perspectives on Macromedia Flash MX 2004
Planning a Flash Web Site for Jackson’s Sports • Determine the goals and objectives of the Web site. • Determine the site’s contents. • Design the site pages and develop a storyboard. • A storyboard is a diagram showing the site’s pages and the way they are organized. • Refer to figure 7-10 in your textbook for an example of a storyboard. New Perspectives on Macromedia Flash MX 2004
Creating the Web Site’s Contents • To create the site’s contents, you start by creating a Flash document that will be the main or home page that is displayed when the user first enters the Web site. • Each Flash document for this Web site should be the same size and have the same background. New Perspectives on Macromedia Flash MX 2004
Creating the Web Site’s Contents Rectangle lines up with the left and bottom edges of the Stage New Perspectives on Macromedia Flash MX 2004
Creating Additional Pages Using a Flash Template • Templates are pre-built documents that can be used as a starting point for many Flash projects. • To create a document based on a template, you select a category from the Create from Template column on the Start page, and then select the template from the New from Template dialog box. • You then click the Templates tab in the dialog box to display the available template categories. • After selecting a template, click the OK button. New Perspectives on Macromedia Flash MX 2004
Creating Additional Pages Using a Flash Template templates template preview template categories template description New Perspectives on Macromedia Flash MX 2004
Creating a Flash Template • Create a Flash document. • Click File on the menu bar and then click Save as Template. • In the Save as Template dialog box, enter a name for the template. • Select an existing template category or create a new category. • Type a description for the template and then click the OK button. New Perspectives on Macromedia Flash MX 2004
Using External Libraries • An external library contains the symbols for a stored document and makes these symbols available to the currently active document. • To open a document’s library as an external library, point to Import on the File menu, and then click the Open External Library command. New Perspectives on Macromedia Flash MX 2004
Creating the Site’s Navigation Bar • Navigation buttons are created the same way as the buttons you created to control animations. • The buttons for a Flash Web site have ActionScript programming code that instructs the Flash Player as to which SWF file to load and how to load it. • The buttons must include obvious visual clues that indicate how the buttons can be used to navigate the site. New Perspectives on Macromedia Flash MX 2004
Creating the Site’s Navigation Bar New Perspectives on Macromedia Flash MX 2004
Using ActionScript • To make the buttons operational, you need to add ActionScript instructions to them. • Adding actions to buttons to control how a movie loads into the Flash Player requires adding actions using the Actions panel. • To load a SWF file into the Flash Player at a specific level, you need to create an ActionScript with the loadMovieNum action. • loadMovieNum(“filename.swf”, level) New Perspectives on Macromedia Flash MX 2004
Using ActionScript • Within the parentheses, you specify the parameters of the action, which give the action the information it needs to execute properly. • Flash uses event handlers to check for events, such as when a button is clicked or when it is released. on (release) { loadMovieNum(“Services.swf”, 1); } New Perspectives on Macromedia Flash MX 2004
Using the Action Panel New Perspectives on Macromedia Flash MX 2004
Adding ActionScript Code to a Button • Select the button instance on the Stage. • Open the Actions panel, select a category from the Actions toolbox, and then double-click an action to add its code to the Script pane. • If necessary, type required code such as parameters that reference filenames. • Click the Check Syntax icon to check the script for errors. New Perspectives on Macromedia Flash MX 2004
Loading External Image FilesUsing the loadMovie Action • Loading external image files into a SWF file in the Flash Player can be accomplished by using the loadMovie action. • This action is similar to the loadMovieNum action, but can be used to load image files into a movie clip instance instead of a level. • The format of the loadMovie action is movieclip.loadMovie(“filename”), where movieclip represents the name of the movie clip instance. New Perspectives on Macromedia Flash MX 2004
Using the loadMovie Action Assigning a name to the movie clip instance Empty movie clip instance Name of instance New Perspectives on Macromedia Flash MX 2004
Using the loadMovie Action Adding the Load Graphic Behavior Type filename of picture Select name of movie clip instance New Perspectives on Macromedia Flash MX 2004
Using the loadMovie Action • When using the loadMovie action, the image files for the pictures need to be in the standard JPEG file format and not in the progressive JPEG format. • The progressive JPEG format causes a picture that is downloading to a Web browser to appear to fade in by gradually downloading the data that makes up the picture. New Perspectives on Macromedia Flash MX 2004
Saving and Publishing the Page • Switch to the page you wish to save and publish, and set the publish settings. • Click File on the menu bar and click Publish Settings. When the Publish Settings dialog box opens, make sure that the Flash (.swf) and the HTML (.html) check boxes are selected. • Click the OK button to close the dialog box. New Perspectives on Macromedia Flash MX 2004
Saving and Publishing the Page • Click File on the menu bar, point to Publish Preview, and then click Default – (HTML). • Close the browser window when you are finished testing the Web site. • Save and close all of the FLA documents. New Perspectives on Macromedia Flash MX 2004
Saving and Publishing the Page Photos page displayed in the Web browser New Perspectives on Macromedia Flash MX 2004