Game Development Reference
In-Depth Information
Any directives that come after the colon are the actions the program should take. In this case, the bul-
let Movie Clip object should stop at frame 1. (Remember that the constant OP=N has the value of -.)
ckpk=j`Opkl$OP=N%7
The last thing the case does is run a ^na]g directive:
^na]g7
This stops the osep_d statement from continuing. It's found what it's looking for, so it doesn't need to
check any of the other cases. If ^qhhapPula isn't op]n, however, the osep_d statement continues
to run and checks the remaining cases.
The next two cases do exactly the same thing, but check for different values:
_]oa_en_ha6
ckpk=j`Opkl$?EN?HA%7
^na]g7
_]oaomq]na6
ckpk=j`Opkl$OMQ=NA%7
^na]g7
If ^qhhapPula happens not to be op]n, _en_ha, or omq]na, the osep_d statement can implement
a backup plan:
`ab]qhp6
ckpk=j`Opkl$?EN?HA%7
The `ab]qhp keyword tells the osep_d statement that if it doesn't find what it's looking for, it should
just run whatever this last directive is. In this case, it stops the playhead at frame 2 in the timeline.
In this example, op]n , _en_ha , and omq]na happen to be strings, so they're sur-
rounded by quotation marks. If you were using values that were not strings, such as
numbers or other variables that represent object names, you would not surround them
with quotation marks.
Figure 10-17 illustrates how all the values in osep_d statements fit together. You should be able to
see that the osep_d statement is just another way of writing a long eb/ahoa statement. In fact, you
can actually replace the entire osep_d statement with an eb/ahoa statement, and the result would be
exactly the same. Here's what it might look like:
eb$^qhhapPula99op]n%
w
ckpk=j`Opkl$OP=N%7
y
ahoaeb$^qhhapPula99_en_ha%
w
ckpk=j`Opkl$?EN?HA%7
 
Search Nedrilad ::




Custom Search