Cast

From Director Online Wiki
Jump to: navigation, search

Description

Scripts

castAttach

on castAttach( aStr_clFilename )
  -- OUTPUT:        0 or err code
  -- INPUT:         string castlibFilePath
  -- DESCRIPTION:   ATTACHES AN UNPROTECTED external CASTLIB
  --                CALL castExists() BEFORE TO AVOID MULTIPLE CAST  INSTANCES.
  -- SAMPLE:        put castAttach( the moviePath & "myXCast.cst" )
  --                -- 0
  tOk = importFileInto( member( (the number of members of castlib 1)+1),  aStr_clFilename )
  return tOK-1
end castAttach

castExists

on castExists( aStr_clName )
  -- OUTPUT:        BOOLE
  -- INPUT:         string castlibFile
  -- DESCRIPTION:   CHECKS WHETHER OR NOT PASSED CAST IS ATTACHED TO MOVIE.
  -- SAMPLE:        put castExists( the moviePath & "myXCast.cst" )
  --                -- 1
  vC = the number of castlibs
  repeat with i = 1 to vC
    if castlib(i).name=aStr_clName then return TRUE
  end repeat
  return FALSE
end castExists