Ask a Question related to Macromedia Director Basics, Design and Development.
spdorsey email@example.com #1
Swapping a sprite with another that is exactly spaced in cast
Lingo - wow.
I'm trying to get a cast member to swap with another on mouseEnter. The other member is exactly 27 spaces forward in the cast.
I'd normally just swap it with the cast member's number, but I need to apply this script to several cast members, all of which have their "swapping" cousins residing 27 spaces forward in the cast.
This would be easier than creating several dozed scripts and applying them to each sprite on the stage.
Here's what I have so far. I'm new at this, so I'm hoping that the error is simple.
on mouseEnter me
set change = the currentSpriteNum of me
set the member of sprite the currentSpriteNum to member (change + 27)
when I use the script, I get a "Property not found" error. I do not know what that means.
Any help is appreciated. Thanks!
:: Web Design
:: Digital Media
spdorsey firstname.lastname@example.org Guest
Hey guys, Have a semi diffucult one here. I have a cast member in sprite(1). It's castNum is 1. It's mask for that member is in memberNum 2....
Try this property oldmem on mouseEnter me oldmem = sprite(me.spriteNum).memNum sprite(me.spriteNum).memNum = oldmem + 27 end
Hey all, "Long time listener, first time caller"... I'm working on a director project with multiple movies playing on the stage, and am...
Hi forum members I am wanting to make a function that will swap a sprite member for a few seconds then restore back. All that I really need to...
I would like to swap one cast member with another one. depending on what button the uses clicks. I tried using the sprite(x).member=member...
Rob Dillon #2
Re: Swapping a sprite with another that is exactly spaced in cast
The way that you have that code written, you're telling your movie to
look ahead in the cast 27 + the number of the current sprite channel.
What you want to do is reference the member number of the member that's
in the current sprite channel.
Something like this:
on beginSprite me
thisSprite = me.spriteNum -- the current sprite channel number
thisMember = sprite(thisSprite).member.memberNum -- the number of the
member in the current sprite channel
on mouseEnter me
sprite(thisSprite).member = member((thisMember + 27),1)
You should always reference a member by it's number and the number of
the cast that it resides in. The default cast is always cast 1.
Rob Dillon Guest