Game Development Reference
In-Depth Information
You can follow exactly the same steps to create ajaiuPsk; just change the names accordingly.
Animating the object
You'll animate the oq^K^fa_p object inside the AjaiuKja symbol. The animation technique you'll use
is called motion tweening . It works by specifying the frame where the motion starts and then an
ending frame where the motion stops. Flash calculates the position of the object for all the frames in
between. That's where the tween comes from: between .
If you've used previous versions of Flash, you'll be happy to know that Adobe has completely rede-
signed motion tweening for Flash CS4. Surprisingly for an animation tool, Flash always had a very
weak animation system: it was finicky and unintuitive, and the fact that every tween had to be
between different instances of an object often meant that any associated ActionScript code went
haywire if the instance names changed in the middle of a complex tweening sequence. Thankfully,
Adobe has remodeled the Flash version 10 animation system on the great-grandfather of all mul-
timedia authoring software: Director. Although predating Flash by eight years, it's much superior
animation system was based on motion paths, and they have now been incorporated into and
supercharged in Flash 10.
Motion tweening is really easy to do, but you have a small problem you need to solve first. You want
to animate the oq^K^fa_p instance inside the AjaiuKja symbol. However, this animation will be show-
cased in the @qjcakjKja symbol, so you need to know what the floor plan of @qjcakjKja looks like for
the animation to look appropriate. You don't want to accidentally animate the object through walls or
outside the edges of the stage. Fortunately, Flash gives you a way to open a symbol's editing window
so that you can still see its context if it's part of another symbol. Here's how:
1. Open the @qjcakjKja symbol editing window.
2. Double-click the ajaiuKja object on the stage that you created in the preceding steps. The
AjaiuKja symbol editing window will open, yet you can still see @qjcakjKja in the background,
which is dimmed slightly (see Figure 8-10). This is perfect for you because you can do the ani-
mation inside the AjaiuKja symbol with the layout of @qjcakjKja to guide you.
Figure 8-10. Double-click the enemyOne instance to open
EnemyOne's symbol editing window with DungeonOne still visible
in the background.
Search Nedrilad ::

Custom Search