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
ini-script
RADStingList (Free Version)
INM's Impressario
Lingo and Shockwave Sourcebook
MostFramesScript
RADMSAgent
Set actionsEnabled Property of a Flash Member
Ripple Follow Mouse on Rollover-Alphamania
myWallpaper
Change Line Direction of a Shape Sprite
 

 

 

Behavior Behavior Documentor

Added on 4/9/2001

 

Compatibilities:
D7 D8 Mac PC Script

Rating:

Author: polysense

Two scripts that can help you prepare written documentation about behaviors: 1) lists each behavior name followed by 2) all user-settable properties with their default values

--DESCRIPTION:
--These scripts are to help create documentation from sets
-- of behaviors. They organize and output text that has
--information about the behavior
--
--AUTHOR: Daniel Cummings
-- behaviordoc@polysense.com
--
-----------------------------------
--Iterate through a cast full of behaviors
--to build a list of documentation on the
--properties, their types and default data
--
--USAGE:
--put getEntireCastBehaviorUserProps("trackerBehaviors")
--
on getEntireCastBehaviorUserProps theCastLibName
  bigBuildString = ""
  cnt = the number of members of castLib theCastLibName
  repeat with i = 1 to cnt
    if (member i of castLib theCastLibName).type = #empty then next repeat
    bigBuildString = bigBuildString  & RETURN & getBehaviorUserPropsAsString(member i of castLib theCastLibName)
  end repeat
  
  return bigBuildString
end

-----------------------------------
--DESCRIPTION:
--Returns a string the holds the comments,
--default values and types for the
--user properties of the behavior script
--you specify in the argument.
--Calls getPropertyDescriptionList() to get
--the data stored with the behavior.
--Does not act on behavior instances
--but on the script itself.
--
--USAGE:
--put getBehaviorUserPropsAsString(member("mybehaviormember"))
--
--Run this function over the behavior Library to
--get the framework of documentation built.
--

on getBehaviorUserPropsAsString theMember
  if theMember.type <> #script then return ""
  hands = theMember.script.handlers()
  if not (hands.getOne(#getPropertyDescriptionList)) then
    buildString = "----------" & RETURN & string(theMember.name) & RETURN & "----------" & RETURN
    buildString = buildString & "No user interface for this behavior." & RETURN
    return buildString
  end if
  
  props = theMember.script.getPropertyDescriptionList()
  cnt = props.count
  
  buildString = "----------" & RETURN & string(theMember.name) & RETURN & "----------" & RETURN
  
  repeat with i = 1 to cnt
    currentProp = props[i]
    buildString = buildString & string(currentProp.comment)
    buildString = buildString && string(currentProp.default)
    buildString = buildString && string(currentProp.format)
    buildString = buildString & RETURN
  end repeat
  
  return buildString
  
end

 


Contact

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

Send e-mail