6TJOH#VUUPOTUP$POUSPM(SBQIJD0CKFDUT

$IBQUFS#POVT5BTLT

In the Timeline, in the Actions layer, select
keyframe 1 and access the Actions panel.
 To create a movement variable, in the
Script pane do the following:
S
Place the cursor at the end of line 31
(after the semicolon) and press Enter
to begin a new line.
S
In lines 32–34, type
&&Xe`dXk\k_\Zc`gXZifjjk_\
jZi\\e
&&jg\\[`eg`o\cj
mXidfm\O1EldY\i4('2
e script should match Script 15.38.
A variable is a scripted container that
refers to a piece of information. e value
('
here represents 10 pixels on the Stage.
e variable
dfm\O
stores this value for
later use. In the animation script you will
create in the following steps, the
dfm\O
variable tells Flash how far to reposition
the movie clip named
Xe`dDZ
.

To dene the
dfm\:c`g
event handler,
do the following:
S
With the cursor at the end of line 34
(after the semicolon), press Enter to
begin a new line.
S
In lines 35–38, type
&&\m\ek_Xe[c\i
]leZk`fedfm\:c`g
g<m\ek1<m\ek 1mf`[
r
t
e event handler for
\ek\i=iXd\
looks
very similar to the event handlers for
button events. e dierence is that
the event is now an
<m\ek
rather than a
Dflj\<m\ek
(Script 15.39).
continues on next page
*(kiXejgXi\ek9ke%X[[<m\ekC`jk\e\i
Dflj\<m\ek%:C@:B#_Xe[c\:c`Zb 2
*)&&Xe`dXk\k_\Zc`gXZifjjk_\jZi\\e
**&&jg\\[`eg`o\cj
*+mXidfm\O1EldY\i4('2
4DSJQU%F¾OJOHUIFNPWF9WBSJBCMFBOE
SFHJTUFSJOHGPSUIFFOUFS'SBNFFWFOU
**&&jg\\[`eg`o\cj
*+mXidfm\O1EldY\i4('2
*,&&\m\ek_Xe[c\i
*-]leZk`fedfm\:c`gg<m\ek1<m\ek 1mf`[
*.r
4DSJQU%F¾OJOHUIFNPWF$MJQFWFOUIBOEMFS