Game Development Reference
In-Depth Information
You can actually add drop shadows, or any of the other filters, to your objects by using
programming code. To do this, you need to import all the filters from Flash's behpano
package using this eilknp directive:
eilknpbh]od*behpano*&7
The asterisk means “all the filters.” It's then a matter of a few more lines of code to
create a filter object and assign it to a Olnepa or Ikrea?hel object. Although this is
a fairly advanced topic at this stage in your learning, you might someday need to
add a filter to some of your objects dynamically. For detailed instructions on how
to do this, visit Adobe's online AS3.0 documentation at dppl6++dahl*]`k^a*_ki+aj[
QO+=_pekjO_nelp+/*,[Lnkcn]iiejc=O/+ . You'll find the details in the chapter called
“Filtering display objects.” Chapter 10 of this topic describes how to use these tech-
niques to create dynamic filters.
Scrolling basics
The key to scrolling is understanding that it's not the lh]uan object that moves; it's the ^]_gcnkqj`
object. The new ^]_gcnkqj` object will become the new center of attention in the following code.
1. Change the kjAjpanBn]ia event handler to look like the following—the bold text indicates
the new code. (You'll find the complete code in the >]oe_O_nkhhejc folder of the chapter's
source files. This example code is in the I]ej[O_nkhhejc[Kja*]o file.)
bqj_pekjkjAjpanBn]ia$arajp6Arajp%6rke`
w
++Ejepe]hevahk_]hr]ne]^hao
r]nlh]uanD]hbSe`pd6qejp9lh]uan*se`pd+.7
r]nlh]uanD]hbDaecdp6qejp9lh]uan*daecdp+.7
r]n^]_gcnkqj`D]hbSe`pd6qejp9^]_gcnkqj`*se`pd+.7
r]n^]_gcnkqj`D]hbDaecdp6qejp9^]_gcnkqj`*daecdp+.7
++Ikrapda^]_gcnkqj`
^]_gcnkqj`*t'9)rt7
^]_gcnkqj`*u'9)ru7
++Opkl^]_gcnkqj`]pop]caa`cao
eb$^]_gcnkqj`*t'^]_gcnkqj`D]hbSe`pd8op]ca*op]caSe`pd%
w
^]_gcnkqj`*t9op]ca*op]caSe`pd)^]_gcnkqj`D]hbSe`pd7
y
ahoaeb$^]_gcnkqj`*t)^]_gcnkqj`D]hbSe`pd:,%
w
^]_gcnkqj`*t9,'^]_gcnkqj`D]hbSe`pd7
y
eb$^]_gcnkqj`*uÌ^]_gcnkqj`D]hbDaecdp:,%
w
^]_gcnkqj`*u9,'^]_gcnkqj`D]hbDaecdp7
y
 
Search Nedrilad ::




Custom Search