At 10:04 AM -0500 1/15/01, Roy Pardi wrote:
>Does anyone understand the different results returned by "number of 
>member" as shown below?
>
>put the number of member "SliderParent" --in castLib 5
>-- 327750
>
>put the number of member "DriveManagerParent" in castLib 1
>-- 2
>
>There are not 327, 750 cast members in this movie-
>--
>

Because "the number of member" always returns a unique identifier 
that represents both the castlib the member is in, and the membernum 
within the castlib.

Each castlib can contain 65536 member.  For backwards compatibility 
reasons with D4 (remember "Shared.cst"), the first castlib (internal) 
is considered castlib #0, while the second castlib is considered 
castlib #2.

Here's an algorithm that explains it (my guess):

   on CalculateNumberOfMember memberNum, castlibNum
       if castlibNum = 1 then
          multiplier = 0
       else
          multiplier = castlibNum
       end
       numberOfMember = (multiplier * 65536) + memberNum
       return numberOfMember
   end

I use "the number of member" very often when I want to find the 
number of successive members in a castlib.  For example, let's say 
that I impose an order where I always have an up button, followed by 
a down button, followed by a gray button.  Then to set this up in a 
behavior, I would do something like this:

property pnmUp  -- property which is the number of member of the up button
property pnmDown
property pnmRoll
property spriteNum

on beginSprite me
    pnmUp = the number of the member of sprite spriteNum
    pnmDown = pnmUp + 1
    pnmRoll = pnmUp + 2
end

Then I can ups pnmUp, pnmDown, and pnmRoll easily and be sure that 
they are refer to the proper cast members.

Irv
-- 
Lingo / Director / Shockwave development for all occasions.

        (Over two millions lines of Lingo code served!)

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to