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.

Chapter 12: Using external files<br />

The familiar HTML tags are all there but in addition within the ‘BODY’ tags are ‘OBJECT’ tags<br />

and with those are ‘EMBED’ tags. ‘OBJECT’ is used by Internet Explorer <strong>to</strong> insert an ActiveX<br />

control. When using <strong>Flash</strong> with IE, the user sees an ActiveX control, usually found in the ‘System32’<br />

folder of the Windows folder. The strange numbered ‘classid’ is simply the Windows way<br />

of finding the control within Windows registry. If the control cannot be found then the ‘codebase’<br />

option tells IE where <strong>to</strong> find the installation program for <strong>Flash</strong> on the Internet; this is a URL address.<br />

The final parameters for the ‘OBJECT’ tag define the width and height in pixels. Following the<br />

‘OBJECT’ tag are several lines beginning with ‘PARAM’. ActiveX technology can be passed in<br />

parameters via the HTML page. A parameter has a name and a value. The ‘movie’ parameter<br />

defines the name of the swf file. This is in URL format so it can reside in a different folder if necessary.<br />

The ‘quality’ parameter controls whether anti-aliasing is used on the display. Some slower<br />

computers struggle <strong>to</strong> display a high quality image and so the frame rate can drop. It is sometimes<br />

useful <strong>to</strong> give the player the option of a higher frame rate at the expense of a poorer display or<br />

vice versa. The final parameter in this example is ‘bgcolor’ which takes a value in hexadecimal<br />

notation.<br />

Numbers do not have <strong>to</strong> use a base of 10. In the familiar place-value decimal notation when a column<br />

reaches 9 and is incremented the next column along has one added and the current column goes <strong>to</strong><br />

zero:<br />

100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110<br />

In the binary system that has only two symbols for numbers once a column has the value one and is<br />

incremented the next column along becomes one and the current column becomes zero:<br />

100, 101, 110<br />

Translating the symbols in<strong>to</strong> a value involves summing the values of the columns:<br />

1111 = 1 ∗ 10 3 + 1 ∗ 10 2 + 1 ∗ 10 + 1 in the decimal system (10 3 simply means 10 * 10 * 10)<br />

1111 = 1 ∗ 2 3 + 1 ∗ 2 2 + 1 ∗ 2 + 1 in the binary system or 15 as a decimal value.<br />

Hexadecimal uses 16 symbols; after 9 there are A,B,C,D,E and F. F is equivalent <strong>to</strong> 15 in decimal<br />

notation. When specifying colours in an HTML document they take the form ‘#RRGGBB’ where<br />

‘RR’, ‘GG’ and ‘BB’ are two hexadecimal values that specify a number between zero and 255 for<br />

red (RR), green (GG) and blue (BB). How is this the case? Take the hexadecimal value ‘00’, this is<br />

simply,<br />

0 ∗ 16 + 0 = 0<br />

171

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

Saved successfully!

Ooh no, something went wrong!