I would do it with some sort of callout system. There would be a global variable, let's call it gTotal, that stores the actual count of the sprites within the other one. Make a #movie script like this:
on getNumWithin vSpriteNum
Then, put the following behaviour onto the sprites that are moveable (i.e. the ones that might be within the bounds of the other sprite)
on AreYouWithin me,vRect
if sprite(me.spriteNum).rect.union(vRect)=vRect then
Now, all you need to do is use the command:
and check the value of gTotal. So basically, if you are checking to see how many sprites are within the bounds of the sprite in channel 10, you would call:
and gTotal would have the correct number of sprites. If you name your sprites (Director 10 and above), you can use the sprite name instead of the sprite number.
Mike - sorry for being an idiot. I get the following script error message -
four parameters expected
Maybe a little more explanation would help:
I have a bitmap circle called "nucleus"
I have bitmap small circles called "protons" that I put into "nucleus" and want a count of.
I'm sure I'm messing up somewhere but have been at it for a while and don't see where I'm going wrong.