Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Groups:
    (PARENT) SCRIPTS / EVENTS

 info D5/601:
      me
      property 
      debug(myObj)  (OOP debugging)
      on startDream (programmer's special)
      Scripts for Editable Fields
 6     21  elements new in Director 6.0,
  !   MANY contain Dictionary fixes 601 & 501,
   +  MANY miss from the 'Appendix' 6.0 for PARENT SCRIPTS,
   +  NO 'Appendix' in 6.0 for EVENTS!


Script Properties (7):
      frameScript
      script of menuItem..of menu
 6    scriptInstanceList of sprite
  !   scriptNum          of sprite
      scriptsEnabled of member  (#movie castMembers)
  !   scriptText     of member  (all members, authoring <> runtime)
  !   scriptType     of member  (#script castMembers)

Parents Scripts & Behaviors (22+):
  !   actorList
  !   ancestor
 6 +  alertHook
   +  birth(script)
 6 +  call(#handler, myObj/script)
 6 +  callAncestor(#handler, myObj/script)
   +  count(myObj/script)
     "debug(myObj)" (OOP debugging)
   +  ilk(myObj, #object), ilk(myObj, #instance)
  !+  me
 6 +  on alertHook me
   +  on birth me
 6 +  on getBehaviorDescription me
 6 +  on getPropertyDescriptionList me
   +  on new me
 6 +  on runPropertyDialog me
      on stepFrame me
      new(script)
   +  objectP(myObj)
      property
 6 +  scriptInstanceList of sprite
   +  scriptType of member
   +  the
   +  ...some of the property LIST commands
         also work on child objects and scripts!

Properties (8):
 6    on getPropertyDescriptionList
 6    on runPropertyDialog
  !   property
      set...=, set...to
  !   # (symbol operator)
 6!   symbol()
  !   symbolP()
      the

Script Communication (29):
      abort
      alert()
 6    alertHook
 6    call()
 6    callAncestor()
x6    dontPassEvent (outdated -> stopEvent)
      exit
 6    externalParamCount()
 6    externalParamName()
 6    externalParamValue()
 6    getPref()  (projector + browser)
      handlerName(object/script)
 6    mMessageList(xtra "name")
 6    on alertHook me
      global
      paramCount, paramCount()
      param()
      pass  (also exits immediately)
  !   put... (into Message window)
      result
      return()  (also exits immediately)
 6    scriptInstanceList of sprite
 6    sendAllSprites()
 6    sendSprite()
 6    setPref()  (projector + browser)
 6    stopEvent  (without exiting)
  !   trace
  !   traceLoad
  !   traceLogFile

--

Primary Event Scripts (16):
      actorList
 6    alertHook
x6    dontPassEvent (outdated -> stopEvent)
      keyDownScript
      keyUpScript
      mouseDownScript
      mouseUpScript
 6    on alertHook me
 6    on cuePassed [me]
 6    on EvalScript...
      on stepFrame me
 6    on streamStatus
      pass
 6    stopEvent
 6    tellStreamStatus()
      timeoutScript

Event Handlers (36):
      on activateWindow
 6    on alertHook me
 6    on beginSprite [me]
      on closeWindow
 6    on cuePassed [me]
      on deActivateWindow
 6    on endSprite [me]
  !    on enterFrame [me]
 6    on EvalScript...
      on exitFrame  [me]
 6    on getBehaviorDescription me
 6    on getPropertyDescriptionList me
      on idle
      on keyDown [me]
      on keyUp [me]
      on mouseDown [me]
 6    on mouseEnter me
 6    on mouseLeave me
  !   on mouseUp [me]
 6    on mouseUpOutSide me
 6    on mouseWithin me
      on moveWindow
      on openWindow
 6    on prepareFrame [me]
 6    on prepareMovie
  !   on resizeWindow
      on rightMouseDown [me]
      on rightMouseUp   [me]
 6    on runPropertyDialog me
      on startMovie
      on stepFrame me
x6    on stepMovie (outdated -> on enterFrame)
      on stopMovie
 6    on streamStatus
      on timeOut
  !   on zoomWindow

--

601 Lingo for SCRIPTS:
Revealed functionality for 'count(object/script)' in 5.0 + 6.0.
Behaviors test TRUE on 'ilk(behaviorOffspring, #instance)'.
Bugfix from the '601 ReadMe': Trying to step through code that
manipulates strings bigger 32K could crash the Lingo debugger.

Outdated SCRIPT Lingo (24):
 5           factory          -> parent scripts (child objects)
 5          birth(factory)    -> new(script) (child objects)
 5         instance           -> property (but ilk(behavior)=#instance)
 5        method              -> on... (handlers in parent scripts)
 5        mAtFrame            -> on stepFrame me
 5        mDescribe           -> put mMessageList(xtra "name")
 5        mDispose            -> none
 5        mGet                -> none
 5        mInstanceRespondsTo -> none
 5        mPut                -> none
 5        mName               -> none
 5        mNew                -> on new me (in parent scripts)
 5        mPerform            -> none
 5        mPut                -> none
 5        mRespondsTo         -> none
 5          makro (in fields) -> on handlerName (in scripts)
 5           on birth(script) -> new(script) (child objects)
 5               on stepMovie -> on enterFrame [me]
 5                when...then -> primary event scripts

 6              dontPassEvent -> stopEvent
 6               mMessageList -> put mMessageList(xtra "name")
 6        put...into variable -> set variable to...
 6      send #handler(script) -> call(#handlerName, object/script)
 6                setCallBack -> none





[index] _ D5/601 _ 971211:


actorList

system property for child objects

6.0 Dictionary Errors, partly the same in 5.0 and the '501 ReadMe':

"The 'actorList' property is a list of child objects..."
= Should read:
"The 'actorList' SYSTEM property is a LINEAR list of child objects..."

"...receive a 'stepFrame' message each time the playback head
    enters a frame ... at each frame advance."
= Should read:
"...receive a 'stepFrame' message each time the playback head
    enters a frame  or an 'updateStage' is issued ... at each
    frame advance or 'updateStage'."

"Clear objects...by setting 'the actorList to [ ]', which is an empty list."
= Not exactly; should read:
"Clear objects...by using the list commands 'deleteAt()' or 'deleteOne()',
 and clear ALL objects...by setting 'the actorList = [ ]', which is an empty
 LINEAR list; for this, you can also use the new list command 'deleteAll()'."

'parent script Moving Ball ... new(script "MovingBall"...'
= Not exactly; Example 1 should read:
'parent script Moving Ball ... new(script "Moving Ball"...'

= Missing:
"See Also: ... on stepFrame, list commands, updateStage"
 --

From the '601 ReadMe':
  Fixed a crash with 'the actorlist' and 'play/play done'.
  --

From the '501 ReadMe':
  All child objects added into the 'the actorList' receive
  a 'stepFrame' event, not an 'enterFrame' message.
  The 'actorList' is an empty linear list ([ ]) to start with, and
  only Lingo can add child objects into it: 'add(the actorList, object)'.
  An example for 'the actorList' is shown as Example 5 in the 5.0 doc's
  entry on 'ancestor', but without an 'on stepFrame me' event handler.
  --

1. TIP: In 6.0, a 'clearGlobals' clears 'the actorList' and sets it to '[ ]'! In Director 4 and 5, the 'actorList' system property will NOT be cleared by a 'clearGlobals' (same as the Lingo elements 'the windowList', 'version', and 'name of the stage', also in 6.0).

2. TIP: Remember: The 'actorList' stays alive across multiple movies, unless you empty it with 'set the actorList = [ ]', as mentioned. Director 4 will crash, if you delete entries from 'the actorList' or 'set the actorList = [ ]' inside an object's 'on stepFrame me' handler (as Kurt Cagle's article 'Lingo for Power Users' used to do). According to John Dowdell from Macromedia Tech Support, this problem does not exist any longer in 4.04, 5.0 and 6.0, although it is still mentioned as a warning in the 6.0 Lingo docs!

3. TIP: At EVERY update of the movie's stage, including 'updateStage' and 'go someFrame' commands (and not just at every advancing of the playback head), Director automatically sends a 'stepFrame' event message to all of your child objects which you added into 'the actorList'. You can use 'set the stageColor = the stageColor', which will NOT trigger a 'stepFrame' event. And see Gretchen's 501 BugList for a workaround from Daniel Goodwin. He made his own 'on replaceUpdateStage' handler, which duplicates 'the actorList', then sets it to '[ ]' (empty), issues the 'updateStage', and then resets 'the actorList'.

4. TIP: Child objects in general are created from a 'Parent Script' castMember by using the command 'new(script parentScriptNameOrNumber)' to call your own 'on new me' birthing handler from that parent script. This is like making a copy of the script, better: a copy of its property variables. Best to put the result of the birthing process into a global variable like 'goMyObject', or to add it into your own global list variable: 'add(gObjectsList, new(script parentScriptNameOrNumber) )'.

5. TIP: For more info, see 'on stepFrame me'.






[index] _ D5/601 _ 971211:


ancestor

child object property

6.0 Dictionary Error:

"For child objects, the ancestor property is usually assigned..."
= Missing:
"Declare the 'property ancestor' at the top of your parent script!"

"set propertyVariable of me to value"
= Wrong syntax; should read:
"set THE propertyVariable of me to value"

"Use the syntax 'the variableName of scriptName'
 to access property variables..."
= Wrong syntax again, shame! Should read:
"Use the syntax 'the variableName of SCRIPT scriptName'
 or 'the variableName of someObject'
 to access property variables..."

...the following passage "This statement allows..." contains
   the same info as given in a paragraph before; delete it!
   A correct example for another OBJECT would be:
   'global goObj1 .. set x = the myProperty of goObj1'.
   The property variables of SCRIPTS themselves
   are ALWAYS void, if they have NOT been set from outside!

= The Example misses info:
"-- script "Dog":
 property breed, ancestor..."
 -- script "Man":
 property race, ancestor..."

= The script "Animal" is completely missing from the Example:
"-- script "Animal":
 property legCount
 on new me
   set legCount = 8
   return(me)
 end new"
 --

From the '501 ReadMe':
  The 5.0 Dictionary's Example 5 belongs to its entry on 'the actorList'.
  --

1. TIP: When making use of the 'ancestor' property in a parent script (of a child object), then best to use the syntax: 'set the ancestor of me = new(script...)'. I once had problems with just saying 'set ancestor = new(script...)'. The 6.0 Dictionary uses 'the ancestor of me' too.

2. TIP: From Irv Kalb 7/97: When you create an object that uses its 'ancestor' property to connect another object to itself (actually just more handlers in another script), then you CANNOT delete the main object by just setting it to FALSE (0), because its 'ancestor' will still refer to it. You have to set its 'ancestor' to FALSE or 0 before deleting the object itself. To do this, include an 'on mCleanUp' handler in your parent script that will have the line: 'set the ancestor of me = 0', and then call 'mCleanUp(goMyObject)' before doing 'set goMyObject = 0'. Include the line 'mCleanUp(ancestor)' and also a similar handler in the ancestor script if the ancestor itself has another ancestor...etc

3. TIP: See the Ldoc+ handler 'debug(myObj)' below for an ancestor debugging script.






[index] _ D5/601 _ 971211:


debug(myObj)

self-made OOP debug handler

After it was mentioned on the objectShop-L mailing list that you can use list commands on scripts and objects, Irv Kalb took it further on the <lingo-l> and came up with a general debugging handler to use in any parent script.

I have been enhancing the following 'debug()' handler, making it a global handler in a movieScript, which can be used by any parent script: 'debug(me)'. It will automatically put all names and values of 'properties' variables of the object AND its's possible 'ancestor' into the Message window of Director, without even knowing the properties' names. Just call the handler with 'debug(anyObject)' -- it's like a 'showGlobals' command for properties of a behavior, child object, property list, or script:

on debug myObj
  --
  put "All properties from the object" & RETURN
  ---
  if NOT objectP(myObj) then return(-1)  --> parameter must be an object!
  --
  
  repeat while TRUE  --> possibly executes a second loop for the ancestor:
    ----
    put myObj & ":" & RETURN
    ---
    --> first get the number of all properties of the object:
    --
    set numberOfMyProperties = count(myObj)
    if (numberOfMyProperties < 1) then return(-1)
    --
    
    repeat with thisProperty = 1 to numberOfMyProperties
      ----
      --> first get each property's symbol name:
      --
      set thisProp = getPropAt(myObj, thisProperty)
      --
      --> ...and then get the value of that property:
      --
      set thisValue = getaProp(myObj, thisProp)
      --
      --> now transform special values for correct string output:
      --
      if      symbolP(thisValue) then set thisValue = "#" & thisValue
      else if   voidP(thisValue) then set thisValue = "VOID"
      else if  (EMPTY=thisValue) then set thisValue = "EMPTY"
      else if stringP(thisValue) then set thisValue = QUOTE&thisValue&QUOTE
      --
      --> ...and put each property into the Message window:
      --
      put  string(thisProp)  &&"="&&  thisValue
      --
    end repeat
    ---

    --> finish if the thing has no valid #ancestor object:
    --
    set myObj = getaProp(myObj, #ancestor)
    --
    if NOT objectP(myObj) then exit repeat  --> finished!
    --
    --> the script has an ancestor, so repeat the above repeat loop:
    --
    put RETURN & "-- Properties from the above thing's ancestor"
    --
  end repeat
  --
end debug





[index] _ D5/601 _ 971211:


me

child object reference term

6.0 Dictionary Errors:

"The 'me' keyword accepts the parameter script Bird and..."
= Example 1 should read:
"The 'me' keyword accepts the parameter 'script "Bird"' and..."

"The second set uses the variable 'myAddress' to refer to..."
= Example 2 should read:
"The second set uses the PARAMETER NAME 'myAddress' to refer to..."
 --

1. TIP: When storing child objects (birthed from parent scripts with the 'on new me' handler) into global variables, it's a good habbit to use variable names starting with 'go' (meaning 'global object'), like: 'global goMyObject .. set goMyObject = new(script parentScriptNameOrNumber)'. The first letter 'g' will indicate to you and to all others comming into touch with your programming that it's a global variable; the following 'o' will indicate that it's an object.

2. TIP: The term 'me' is commonly used for the object itself (i.e. its address in memory). If you call the handler of an object from outside the object's script, the object's ID (memory address) is always sent along in the form <offspring "parentScriptName" numberOfChild memoryAddress>. If the object's handler accepts parameters, then the first parameter of the handler MUST be prepared to receive this ID, and is therefore commonly called 'me', otherwise there would be a shift of parameters to the right.

3. TIP: When you make use of the 'ancestor' property for a child object, in the parent script you MUST address the properties of the ancestor script(s) by using the expression: 'the propertyName of me'.

4. TIP: You can test AND set properties of a child object from outside by using: 'set the propertyName of goMyObject = 99'.

5. TIP: You can use (property) list commands on scripts, like 'count(script memberNameOrNumber)' or 'getAt(script memberNameOrNumber, 1)' as well as on child objects: 'getAt(goMyObject, 1)', see 'debug(myObj)' for an EXAMPLE.

--

EXAMPLE:

The command 'put the paramCount' inside the following handler returns 3, because in this case the handler is actually receiving 3 parameters, the first of which is the object's ID:
global goMyObject
--
put goMyObject
-- <offspring "myParentScript" 3 248ad0>


DoSomethingHandler(goMyObject, firstParam, secondParam)


--> The parent or ancestor script of 'goMyObject' needs to have
--> a handler in the following form:
--
on DoSomethingHandler ME, firstParam, secondParam
  --
  put the paramCount
  -- 3
  --
  put ME
  -- <offspring "myParentScript" 3 248ad0>
  --
  put objectP(param(1))
  -- 1
  --
end DoSomethingHandler





[index] _ D1/702 _ 970606:


on startDream

a Lingo workaround to forget your problems


TIP: The following handler was posted by Patrick McClellan in CompuServe's Macromedia Forum; it's so nice, I just have to let you know (by Pat's kind permission):

>>
I've been having a problem that I'm sure many others have had to deal with, so to make things easier, I've written a handler which everyone may feel free to use (royalty free!)
The problem is that when I get very involved in a program, I can't seem to leave it on my computer. Specifically, I spend what seems like hours in the middle of the night dreaming Lingo scripts. Occasionally, I'll wake up with a helpful new approach to a problem, but usually, it's just meaningless. So, I've written this handler...
on startDream
  repeat while the stillDream
    if the useful of dream (thisDream) = TRUE then
      beginRecording
        set the remember of dream (thisDream) = TRUE
      endRecording
    else
      set the movieRate of dream (thisDream) = 0
      go to movie "DeepSleep"
    end if
  end repeat
end startDream

This is my first draft at it. It's working pretty well, but sometimes I still get caught in some kind of loop where I think I'm out of the repeat, and then I'm back in it. Although I must warn you that it doesn't work with the new version of the Shockwave plugin on Internet Explorer... 8-)  I welcome any improvements or suggestions.

Pat McClellan

http://ourworld.compuserve.com/homepages/PatMcClellan
<<






[index] _ D5/601 _ 971212:


on stepFrame me

child object event message handler

6.0 Dictionary Errors (is missing from the 5.0 docs!):

"Syntax:  on stepFrame..."
= Should read:
"Syntax:  on stepFrame ME..."

"...contains statements that run when...or the Stage is updated."
= Missing:
"...contains statements that run when...or the MOVIE'S stage is updated.
 Using 'set the stageColor = the stageColor' does also update
 the movie's stage, but without sending a 'stepFrame' event."

...'stepFrame' handlers work in MIAW's too, not only for 'the Stage'!
   Here's a mis-match between 'the Stage' and 'a stage update'...

"This handler only works in scripts...in 'the actorList'..."
= Should read:
"This handler only works AUTOMATICALLY in scripts...in 'the actorList'..."

...'stepFrame' handlers work perfectly anytime YOU call them! ;-)

"...each time the playback head enters a frame."
= The Example should read:
"...each time the playback head enters a frame or the movie's stage
    is updated with a 'go to...' or 'updateStage' command."

"on move me ... return me..."
= No need to 'return me' in this Example; delete it!

= Missing:
"See Also: the actorList, me keyword, new() handler"
 --

From the '6.0 ReadMe':
  The 'go to...', 'play...', 'puppetPalette', and 'updateStage'
  commands are disabled in the following handlers: 'on prepareMovie',
  'on prepareFrame', 'on beginSprite', 'on endSprite', 'on stepFrame'.
  --

From 'Macromedia Director Corrections':
  The second paragraph in the Dictionary's description is
  incorrect. See Macromedia's Corrections for exact info...
  --

1. TIP: Director automatically sends all child objects added into 'the actorList' a 'stepFrame' event everytime the movie's stage is updated. To react to this event, child objects need to have an 'on stepFrame me' handler in their parent or ancestor scripts. Inside the object's 'on stepFrame me' handler you write your code for what the object is supposed to do when it receives the 'stepFrame' event; most likely it's supposed to animate one step <g>.

2. TIP: Do NOT put anything time-consuming into your 'stepFrame' handler, and especially NO 'updateStage', as this will happen anyway automatically after this event handler finishes, because it executes before the 'enterFrame' and the (6.0) 'prepareFrame'!

3. TIP: Like any other Director event message, a 'stepFrame' event CANNOT transport and pass any parameters (except the object's ID which you catch with the parameter name 'me').

4. TIP: For more info and problems, see 'the actorList'.

--

EXAMPLEs:

The following will create a child object into a global variable and then add the object to 'the actorList', from where it will receive its regular 'stepFrame' events. The object is created from the following 'on new me' handler in the script castMember "MyParentScript" (scriptType #parent) in any castLib:
on new me
  return me
end new

on stepFrame me
  global my1objectChannel
  set the puppet of sprite my1objectChannel = TRUE
  set the blend  of sprite my1objectChannel = 25 + random(75)
end stepFrame
---

put the scriptType of member "MyParentScript"
--#parent

--> Now any handler in any script can do this:
--
global my1object,my1objectChannel
--
set my1objectChannel = 15
--
set my1object = new(script "MyParentScript")
--
add(the actorList, my1object)
...and each time the movie's playback head moves, or you get the movie's stage updated by Lingo, the sprite in channel 15 will change its blend appearance on stage.


Here is the 5.0 Dictionary's missing 'on stepFrame me' event handler for its entry on 'actorList', adapted from the '501 Readme' and enhanced:
on stepFrame me
  global gStartTime, gIntervall, gCurrentSegment
  --
  set runTicks = (the ticks - gStartTime)
  --
  if ((runTicks / gIntervall) <> gCurrentSegment) then
    AdvanceClock(me)
  end if
  --
end stepFrame





[index] _ D5/601 _ 971211:


property

variables category keyword

6.0 Dictionary Errors, partly the same in 5.0:

"For behaviors, properties...are available..."
= Missing:
"...using the syntax: 'the propertyName of the spriteNum of me'"

= Missing:
"Properties are also elements of property lists!"

"This statement allows..."
= Example 1 misses:
"This statement AT THE TOP OF A SCRIPT allows..."

"set the spriteNum of me = spriteNumber"
= Wrong syntax; Example 3 should read:
"set spriteNum = spriteNumber"

= Missing:
"See Also: ... the (keyword), set...to, property list commands"
 --

From the '501 ReadMe':
  You CANNOT use 'put...into' to change properties,
  property variables, or values in property lists;
  for these you MUST use the 'set...to' command.
  --

1. TIP: Properties in general are values that belong to a Director object (sprite, member, script, point, rect, user-defined property list, user-defined child object, user-defined window, Xtra or XObject, etc), and are addressed using the keyword 'the': 'the propertyName [of...]'. You can test and 'set' properties, but NOT 'put...into' properties, you have to use 'set the propertyName [of...] = ...'.

2. TIP: Avoid using the same name for your property variable and for a local or global variable or a handler name, as this might cause problems. To use a name which is a Lingo keyword or a Lingo property, add something in front of it, which can also be a code indicating what kind of variable it is, like: 'mySprite' (property), 'gName' (global), 'goObj1' (global object), 'aText' (local), 'thisNumber' (argument), etc.

3. TIP: Even without being a parent script, every script can have its own set of property variables (declared at the top), and you can test AND set them by addressing them with 'the propertyName of script memberNameOrNumer'. You can even 'set x = script memberNameOrNumer' and then address 'the propertyName of x'. Also you can use (property) list functions on scripts, like: 'count(script memberNameOrNumber)'.

4. TIP: You can test AND set properties of a child object from outside its handlers by using: 'set the propertyName of goMyObject = 99'. You can use (property) list functions on child objects and scripts, like: 'count(object)'.

5. TIP: Instead of using one of the different flavors of the 'getProp()' and 'setProp()' functions, you can test AND set entries in property lists by using the keyword 'the' like you do with the property variables of a child object: 'set the myPropertyName of myPropList = 999'. As Kurt Cagle put it: "Not only is this more immediately intuitive, it's also actually quicker to type."






[index] _ D5/601 _ 971211:


put

Lingo debugging command

From the '601 ReadMe':
  The PUT command in Lingo works for SWA members. (??)
  --

From the '501 ReadMe':
  You CANNOT use 'put...into' to change properties,
  property variables, or values in property lists;
  for these you MUST use the 'set...to' command.
  --

1. TIP: Having something 'put' into the Message window is quit time consuming. Be sure to remove or comment out all such lines in your code when things get time critical. And NEVER forget to 'Recompile Scripts' and to 'Save and Compact' before protecting a movie, or putting it into a projector, or compressing (afterburning) it.

2. TIP: A helpful way to enhance the debugging of your own Lingo code is to have the values of some things 'put' out in the Message window during author-time. By using a global 'gDebug' flag variable, you can turn the output of such user-defined messages on or off by setting that variable in the Message window (where it will automatically be defined as global), or by using a key combination in 'the keyDownScript' of your Lingo (must declare the variable to be global), or in a button script, which also must declare the variable to be global. In any of your handlers, have some expressions 'put' into the Message window, added by personal remarks to help you understand, depending on the status of the global switch.

3. TIP: See the Ldoc+ handler 'debug(myObj)' above for a child object debugging script.

--

EXAMPLEs:

The following lines use the global flag variable 'gDebug':
global gDebug

--> Turn the output of your 'put' messages on:
--
set gDebug=1

--> To turn the output of your 'put' messages off again:
--
set gDebug=0

--> Then in any of your handlers have lines like:
--
global gDebug
--
if (gDebug) then put ("myVariableName:" && myVariableName)
if (gDebug) then put ("propertyName:  " && the propertyName of someThing)

put (the runMode)
-- "Author"
--
if (the runMode = "Author") AND (gDebug) then
  put ("I'm debugging during author-time, because 'gDebug' =" && gDebug)
end if





[index] _ D5/601 _ 971211:


scriptNum of sprite

sprite script number property

6.0 Dictionary Errors, partly the same in 5.0:

"(To see a complete list...in the Behavior Inspector.)"
= Should read:
"(To see a complete list...in the Behavior Inspector,
 or test 'the scriptInstanceList of sprite'.)"

"...can be tested, but not set."
= Should read:
"...can be tested AND set, e.g. during score recording."

= Missing:
"See Also: the scriptInstanceList of sprite,
 the scriptText of member, the name of member,
 call(), callAncestor(), sendAllSprites(), sendSprite()"
 --

From 'Macromedia Director Corrections':
  This property can be set only during score recording.
  --

1. TIP: If you test a sprite which has no sprite script attached to it in that frame, the 'scriptNum of sprite' returns 0. Use this result to turn 'the cursor of sprite' off for that sprite, or to decide which actions to take in a handler depending on a tested sprite being interactive or not.

2. TIP: Remember: During author-time, you can test AND set 'the scriptText of member scriptNameOrNumber', but when the movie is protected and/or put into a projector, all scripts lose their 'scriptText' property.

--

EXAMPLEs:

put the scriptNum of sprite 9
-- 0

set oldLock = the updateLock
set the updateLock = TRUE
--
beginrecording
  set the scriptNum of sprite 9 = the number of member "ButtonScript"
  updateFrame
endRecording
--
set the updateLock = oldLock

put the scriptNum of sprite 9
-- 196658
put member 196658
-- (member 50 of castLib 3)
put the name of member 196658
-- "ButtonScript"

put the scriptText of member (the scriptNum of sprite 9)
-- "on mouseDown
  myHandler(the clickOn)
end"

put (the scriptType of member (the scriptNum of sprite 9) = #score)
-- 1





[index] _ D5/601 _ 971211:


scriptText of member

script member and cast script property

6.0 Dictionary Errors, partly the same in 5.0:

"...indicates the content
    of the script, if any, assigned to the cast member..."
= Misses info; should read:
"...indicates the content of a script castMember, or
    of the cast script, if any, assigned to a castMember..."

"...removed when the movie is converted into
    a projector or compressed for Shockwave."
= Misses info; should read:
"...removed when the movie is PROTECTED, or converted into
    a projector, or compressed for Shockwave."

"Such movies lose their values
 for the 'scriptText of member' property."
= Misses info; should read:
"Such movies RESET ALL values 
 for the 'scriptText of member' property to EMPTY (""),
 which is also the default value for a castMember
 with no script attached to it."

"Therefore, the movie's values for 'the scriptText of member'
 can't be used by a projector."
= Should read:
"Therefore, the movie's ORIGINALLY assigned scriptText contents...
 can't be used by a projector."

"Director can set new values for 'the scriptText of member'
 inside the projector."
= Misses info; should read:
"Director can set new values...inside the projector,
 but they will NOT persist across different movies or sessions,
 unless a 'saveMovie' command is issued for a movie
 that has NOT been previously protected."

= Missing:
"See Also: the scriptInstanceList of sprite,
 the scriptNum of sprite, the scriptType of member"
 --






[index] _ D5/601 _ 971211:


scriptType of member

script member type property

6.0 Dictionary Errors:

= Missing:
"Can be tested AND set."

"Possible values are #MOVIE, #SCORE, and #PARENT."
= Symbols are not case-sensitive, but should read:
"Possible values are #movie, #score, and #parent."

= Missing:
"See Also: the scriptInstanceList of sprite,
 the scriptText of member, new(#script)"
 --

5.0 Dictionary Errors, cleared in 6.0:

"Syntax:  scriptType of script"
= Should read:
"Syntax:  scriptType of member"

"Possible values are #MOVIE, #SPRITE, #FRAME, and #PARENT."
= Wrong; should read:
"Possible values are #movie, #score, and #parent."
 --

1. TIP: The 'scriptType of member' can be tested AND set; the default is what you declared the script to be in its 'Cast Member Properties' dialog box. Remember: When you create a new script, either by clicking on the '+' button (New Script) in Director's Script window, or by using Lingo's 'new(#script)' function, you automatically create a new #movie script! Don't forget to switch it to 'Type: Score' or reset its 'scriptType of member' to #score if you want to use it for a sprite or a frame instead. Sometimes this mismatch can be disasterous, so best to occasionally check the types of all your script castMembers.

2. TIP: When testing 'the scriptType of member' for other than script members, you get an error alert, so best to first check 'if (the type of member nameOrNumber = #script)'.

3. TIP: You can switch whole movieScripts by setting 'the scriptType of member' of another reserved script to #movie and then turning the old movieScript(s) to #score (on reserve). By doing this you can bring in or take out handlers from Director's stream of events.

4. TIP: You can call any handler in any kind of script by addressing it by its name or number, the keyword 'script', and the name of the script it is in: 'handlerName(script memberNameOrNumber, optionalParameters)'. EXAMPLEs: 'mouseDown(script "Button Click")'. In 6.0, you can use the new 'call()', 'callAncestor()', 'sendAllSprites()', and 'sendSprite()' functions for this.

5. TIP: If you use a script of type #movie (global) or #score (local) to contain a parent script (like in Director 4) and birth child objects from an 'on new me' handler, Director's own 'new(#memberType)' function will be disabled and call your customized 'on new me' handler instead. If you still think that you need this kind of scripts, then change the 'on new me' handler to 'on birth me', and birth the child object by calling 'birth(script memberNameOrNumber)'.

--

EXAMPLEs:

The following could be part of a script type #score, named "TestScript":
--> script "TestScript":
--
property myDenis
--
on exitFrame
  set the myDenis of (script "TestScript") = "Fine!"
end exitFrame


--> Then later from some other script:
--
put the myDenis of script "TestScript"
-- "Fine!"
set the myDenis of script "TestScript" = "Ok."

if (the type of member "TestScript" = #script) then
  --
  set thisScript = script "TestScript"
  --
  if objectP(thisScript) then
    if NOT (the myDenis of thisScript = "Ok.") then beep
  end if
  --
end if





[index] _ D5/601 _ 971211:


set...=, set...to

basic Lingo command

1. TIP: The 'set' command works with variables, and it's specialized for properties, but it does NOT work with chunks (chunks of fields and strings like chars, words, lines, items).

2. TIP: You can use the 'set' command for entries in property lists like you do with the property variables of a child object: 'set the propName of aPropList = (the propName2 of aPropList) + 99'.






[index] _ D5/601 _ 971211:


the

properties addressing keyword

6.0 Dictionary Errors, partly the same in 5.0:

"Properties are globally availabel to handlers
 without a global declaration..."
= Not exact; should read:
"Properties are availabel to handlers in the same script,
 or globally using 'the propertyName of...' construction..."

= Missing:
"Properties are also elements of property lists, and can be
 addressed using this keyword: 'the propName of aPropList'!"

= Missing:
"See Also: property (keyword), me (keyword), set...to"
 --

1. TIP: Properties are always addressed using Lingo's keyword 'the', see more info at 'property'.

2. TIP: You can use the keyword 'the' to address entries in property LISTS, if they are symbols. Instead of using one of the different flavors of the 'getProp()' and 'setProp()' list functions, you can test AND set those symbol entries in property lists by using the keyword 'the' like you do with the property variables of any other object (without ussing its symbol sign #): 'set the propertyName of aPropList = 999'. As Kurt Cagle put it: "Not only is this more immediately intuitive, it's also actually quicker to type."'

3. TIP: You can test AND set entries in a 'point()' and a 'rect()' by using Lingo's keyword 'the': A point has 'the locH / locV of point()', and a rect has 'the left / top / right / bottom / width / height of rect()'. See EXAMPLEs for this at 'setAt()'.

--

EXAMPLEs:

set myPropList = [#Lingo:"script language", #Bingo:"game", #Denis:"player"]
--
put the Lingo of myPropList
-- "script language"
--
set the Lingo of myPropList = "tricky"
put myPropList
-- [#Lingo: "tricky", #Bingo: "game", #Denis: "player"]





[index] _ D5/601 _ 971211:


trace

Lingo debugging property

6.0 Dictionary Errors, same in 5.0:

= Missing:
  The Dictionary doesn't tell what happens when 'the trace = TRUE':
"The Message window, when tracing is on, displays a record
 of the frames that play and the handlers that run in the movie.
 See 'Learning Lingo' 6.0 on page 53."

= Missing:
"The default value is FALSE."
...also the third bullet is not supposed to be a bullet!

= Missing:
"See Also: the traceLoad, the traceLogFile"
 --

TIP: You can test AND set 'the trace', and its default is FALSE (0), if you have not activated the trace button in Director's Message window. Setting 'the trace = TRUE' will echo and monitor each line of executed scripts in the Message window, which will slow down your movie to slow motion. If you don't succeed in interrupting the process (i.e. during a Lingo repeat loop), press Command+period (Mac) or Control+period (Win) a couple of times to stop your whole movie running... <g> Also remember 'the traceLoad' and 'the traceLogFile', because those properties enable more/different debugging.






[index] _ D5/601 _ 971211:


traceLoad

Lingo debugging property

6.0 Dictionary Errors, same in 5.0:

= Missing:
  The Dictionary doesn't mention where the information
  is dislayed when 'the traceLoad > 0':
  In the Message window, and in the file if a name
  for 'the traceLogFile' has been specified.

= Typo:
"The 'traceLoad' property can BE tested and set."

= Missing:
"The default value is 0."

= Missing:
"See Also: the trace, the traceLogFile"
 --






[index] _ D5/601 _ 971211:


traceLogFile

Lingo debugging property

6.0 Dictionary Errors, same in 5.0:

= Missing:
'The 'traceLogFile' property can be tested and set.
 The default value is EMPTY ("").'

'set the traceLogFile = "Messages" '
= The Example should read:
'set the traceLogFile = "Messages.txt" '
...Windows will not like a file without extension.

= Missing:
"See Also: the trace, the traceLoad"
 --

TIP: You can test AND set 'the traceLogFile', and its default is an EMPTY string (""). But the defined log file will NOT be available until 'the traceLogFile' property is set back to EMPTY (""), or until the program quits. Of course, setting this property only makes sense when used together with 'the trace' or 'the traceLoad'.





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_Scripts.html"  (971212)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de
 Top