02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

is presumed,<br />

www.niklever.net/flash<br />

will find the same file.<br />

All HTML documents have the format<br />

<br />

<br />

A very simple web page<br />

<br />

<br />

This is the content of the web page.<br />

<br />

<br />

Chapter 12: Using external files<br />

Most HTML tags have the form … where ‘TAG’ is the start of a tag and ‘/TAG’<br />

is the end of that tag. Most tags can be nested inside other tags. You may well have your favourite<br />

program for creating HTML pages: ‘Frontpage’ and ‘Dreamweaver’ are just two. But it is useful <strong>to</strong><br />

know what is being created when you author an HTML page. Essentially you just create a text file.<br />

Whenever an image is added the image is not part of the document; instead a URL is created. This<br />

can be a direct link <strong>to</strong> the image such as ‘http://www.niklever.net/flash/images/masthead.jpg’ or<br />

alternatively in the current example we can just use ‘images/masthead.jpg’ which is a relative link<br />

<strong>to</strong> the file, relative in respect of the current page, http://www.niklever.net/flash/index.html. We<br />

look in the image folder and find the file ‘masthead.jpg’. When you create a <strong>Flash</strong> game you can<br />

choose <strong>to</strong> ‘publish’ the game. Figure 12.1 shows the ‘Publish Settings’ dialog box that is accessed<br />

from ‘File/Publish Settings...’.<br />

The check boxes that are checked by default are ‘<strong>Flash</strong>’ and ‘HTML’. When you create a <strong>Flash</strong><br />

game the project file is an ‘FLA’ file. When you publish this file it is in the compressed form of an<br />

swf file. In order <strong>to</strong> view this file on the Internet you will link <strong>to</strong> the HTML file, not the swf file.<br />

Linking <strong>to</strong> the swf file directly will simply bring up a file download box if you have the rights <strong>to</strong><br />

download files from the folder. Here is an HTML file produced using <strong>Flash</strong> Publish.<br />

1 <br />

3 <br />

4 <br />

5 <br />

7 remote<br />

8 <br />

9 <br />

10 <br />

11 <br />

169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!