Game Development Reference
In-Depth Information
All those elements were created as symbols in the Library . When you publish a SWF file, it will display
only what has been added to the FLA file's main stage. So far, the main stage of the FLA is blank.
You can check this by opening ejpan]_peraOpknu^kkg*bh] and clicking the Scene 1 button at the
top of the stage. You'll just see a blank white stage—there's nothing there—which is what the SWF
displayed.
This illustrates an important concept. Symbols in the Library can't be seen unless you create an instance
of them on the main stage. The first bit of code that you'll add will do exactly that.
Let's add the lines of code to see the first page of the storybook:
3. Add the following to the I]ej*]o file (your ActionScript editor window will look like Figure 3-1
when you're done):
l]_g]ca
w
eilknpbh]od*`eolh]u*Ikrea?hel7
lq^he__h]ooI]ejatpaj`oIkrea?hel
w
r]nop]npL]ca6Op]npL]ca7
lq^he_bqj_pekjI]ej$%
w
op]npL]ca9jasOp]npL]ca7
]``?deh`$op]npL]ca%7
y
y
y
Figure 3-1. Add the code to the Main.as file in the
ActionScript editor window.
4. Save the I]ej*]o file.
5. Test the project. You should see the ejpan]_peraOpknu^kkg*osb movie displayed with the first
page. You'll even be able to click the buttons, although they won't do anything just yet.
 
Search Nedrilad ::




Custom Search