
11
Fetching cast members
Fetching cast members
Use the global function castLib(), which returns a
reference to a Cast Library core object.
firstMember = castLib(1).member[1]
Cast library 1 is the default library,
and member 1 is the first cast member.
You can also say
member = castLib(1).member[”tomato”]
to fetch the cast member named tomato.
Fetching sprites
Fetching sprites
Use the global function channel(), which returns a
reference to a sprite channel.
firstSprite = channel(1).sprite
returns the sprite that is in the first sprite channel
for the current frame.
If a different sprite occupies channel 1 in the
next frame, that sprite will be returned.
Access the corresponding cast member by saying
castMember = firstsprite.member
Kommentare zu diesen Handbüchern