Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
simZip Xtra
WebXtra
AnyShape Xtra
USBXtra
OggXtra
Lingo MarkUp Xtra
Replace returns with PC line breaks
Valentina
FilmLoop Controller
MADPlayer
 

 

 

Behavior authoring method docSprite()

Added on 3/1/2004

 

Compatibilities:
D8_5 D9 Mac PC Script

This item has not yet been rated

Author: benjamin (website)

-- RETURNS: string -- PARAMS: int channnel, int frame -- DESCR.: documents a sprite's scriptList as string -- EXAMPLE: put docSprite(20,2)

on docSprite( aIntCh, aIntFr )
  --   RETURNS:       string
  --   PARAMS:        int channnel, int frame
  --   DESCR.:        documents a sprite's scriptList as string
  --   EXAMPLE:       put docSprite(20,2)
  --                  -- "
  --                  -- ** scripts on sprite(20) in frame(2/"label_A") ** --
  --
  --                  myBhv    {member 10, 1}
  --                      a:    20
  --                      b:    0
  --
  --                  myBhv_02    {member 11, 1}
  --                      prop1:    20
  --                      prop2:    0
  --
  --                  --/** scripts on sprite(20) in frame(2) ** --"


  tStr = ""

  if integerP(aIntCh) then
    if integerP(aIntFr) then


      beginRecording


        tOldFrame = the frame
        go frame(aIntFr)


        if the framelabel=0 then
          tFrameLabel = ""
        else
          tFrameLabel = QUOTE & the framelabel & QUOTE
        end if

        put RETURN & "-- ** scripts on sprite("&aIntCh&") in frame("&aIntFr&"/"&tFrameLabel&") ** --" after tStr
        put RETURN after tStr

        tScriptList = sprite(aIntCh).scriptList
        repeat with i = 1 to tScriptList.count

          tScript = tScriptList[i]

          put RETURN & tScript[1].name after tStr
          put TAB &"{member "& tScript[1].memberNum &", "& tScript[1].castlibNum &"}" after tStr

          tSettings = value(tScript[2])
          if listP(tSettings) then
            repeat with j = 1 to tSettings.count

              put RETURN &TAB& tSettings.getPropAt(j) &":"&TAB& tSettings[j] after tStr

            end repeat
          end if

          put RETURN after tStr

        end repeat

        put RETURN & "--/** scripts on sprite("&aIntCh&") in frame("&aIntFr&") ** --" after tStr

        go frame(tOldFrame)


      endRecording


    end if
  end if

  return tStr
end docSprite

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail