Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Random Rob webforumsuser@macromedia.com #1
Changing cast member with a mouse click
Im trying to change the castmember of a sprite each time it is clicked on. I've managed to do it so that it changes just the once by using the
"set the membernum of sprite 2 to 2" but i want it to change to another cast member each time it is clicked.
Please help me.
Cheers,
Rob
Random Rob webforumsuser@macromedia.com Guest
-
3D cast member access
hi all, i want to exchange 3d model data with a director app and a 3rd party application at runtime. because the data must go both ways and... -
How to let objects in a cast member be a child of agroup(or a model) in another cast member?
I want to add a model to the scene. I try this code: member('world').newgroup('gr2') member('world').group('gr2').addchild(member('r2').model(1)) ... -
changing the cast number of a cast at authoring time?
is it possible to change the cast number of a cast at authoring time? -
maintaining sprite position when changing cast member
It should apear in the same place. If it's a bitmap or vector check the registration point in the bitmap or vector editors. Des -
Move mouse cursor to X,Y location and simulate mouse click
Hi, Just something that slip my mind.. but how do you move the mouse cursor to a sprite member and simulate a mouse click? Any help is... -
davis #2
Re: Changing cast member with a mouse click
i didnt try this but it may be worth a shot
set changeMember = random(10) <-- this should be the number of sprites you
have
set the membernum of sprite 2 to changeMember
hope this works
davis Guest
-
Random Rob webforumsuser@macromedia.com #3
Re: Changing cast member with a mouse click
Thanks for your reply,
i tried your suggestion and it works
however i have a couple of questions.
how can i tell director which cast members to use as it only seems to use the first 4 if i enter
set changeMember = random(4).
This is fine for some of the sprites but i would like others to use the next 4 castmembers.
Also, is it possible to change the members in order as opposed to random?
Thanks for your help.
Rob
Random Rob webforumsuser@macromedia.com Guest
-
Mark A. Boyd #4
Re: Changing cast member with a mouse click
On 06 Dec 2003, "Random Rob" [email]webforumsuser@macromedia.com[/email] wrote:
I would probably use a list of cast member references. I would create the> Im trying to change the castmember of a sprite each time it is clicked
> on. I've managed to do it so that it changes just the once by using
> the "set the membernum of sprite 2 to 2" but i want it to change to
> another cast member each time it is clicked. Please help me.
list using the member names instead of memberNums since the memberNum could
change at any time if you move the castMembers around.
Here's a very basic example that is hard-coded to the member names, but
should help get you started.
property plMembers
property pIndex
on beginSprite me
plMembers = [member("red"),member("green"),member("blue")]
pIndex = 1
end
on mouseUp me
pIndex = pIndex + 1
if pIndex > plMembers.count then
-- go back to first member
pIndex = 1
end if
sprite(me.spriteNum).member = plMembers[pIndex]
end
--
Mark A. Boyd
Keep-On-Learnin' :)
Mark A. Boyd Guest



Reply With Quote

