Game Development Reference
In-Depth Information
If you entered the code from the last section in the I]ej[?d]n]_pan*]o file, you could try modifying
it with this new code, but it might be safer just to erase it all and start again. There are enough differ-
ences in the code to make it an almost completely new program. Let's create a new class file for this
example:
1. In the Project panel, click the New File button (you'll find it in the bottom-right corner of the
panel). Make sure that ActionScript is selected as the file type.
2. Enter Main_Character_Two in the File field.
3. Click the Create button.
4. The I]ej[?d]n]_pan[Psk*]o file opens as a blank document in a new ActionScript editor
window.
5. You need to set I]ej[?d]n]_pan[Psk*]o as the FLA's document class. Open the _d]n]_pan?kjpnkh*
bh] file and enter Main_Character_Two in the Class field.
6. Save the _d]n]_pan?kjpnkh*bh] file.
7. Open the I]ej[?d]n]_pan[Psk file.
8. Add the following new code to the I]ej[?d]n]_pan[Psk*]o file (again, if you prefer not to
type it, you'll find the finished file in the ?d]n]_pan?kjpnkh folder in this chapter's source
files):
l]_g]ca
w
eilknpbh]od*`eolh]u*Ikrea?hel7
eilknpbh]od*arajpo*Gau^k]n`Arajp7
eilknpbh]od*qe*Gau^k]n`7
eilknpbh]od*arajpo*Arajp7
lq^he__h]ooI]ej[?d]n]_pan[Pskatpaj`oIkrea?hel
w
r]nrt6ejp7
r]nru6ejp7
lq^he_bqj_pekjI]ej[?d]n]_pan[Psk$%
w
ejep$%7
y
bqj_pekjejep$%6rke`
w
++Ejepe]hevar]ne]^hao
rt9,7
ru9,7
++=``arajpheopajano
op]ca*]``ArajpHeopajan$Gau^k]n`Arajp*GAU[@KSJ(kjGau@ksj%7
op]ca*]``ArajpHeopajan$Gau^k]n`Arajp*GAU[QL(kjGauQl%7
]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjAjpanBn]ia%7
y
 
Search Nedrilad ::




Custom Search