> How do I check whether a graphic exists in a cast library.

Search through each member in the castLib by name, checking for the one
you want:

------------
on GetMember strMemName, inCastLib
  bFoundMember = FALSE
  
  if ( inCastLib < 1 ) or ( inCastLib > the number of castLibs ) then
    return #invalidCastLibIndex
  end if
  
  intMemsInLib = the number of members of castLib inCastLib
  repeat with i = 1 to intMemsInLib
    if member( i,inCastLib ).name = strMemName then
      return member( i,inCastLib )
    end if
  end repeat
  
  if not( bFoundMember ) then return #memberNotFound
end

Call the function like this:

theMember = GetMember( "myLogo", 2 )
if symbolP( theMember ) then alert "ERROR: #GetMember failure"

Hope it helps,
Rob

/*********************************
* Rob Wingate, Software Human    *
* http://www.vingage.com         *
* mailto:[EMAIL PROTECTED] *
*********************************/

[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