Relationships between some Lingo related objects

This document represents information about Lingo, the script language of Macromedia_Director_MX. This permits to let you quickly access (by reading, querying or navigating) and see a list of important relations associated to each important object related to Lingo. This can therefore be seen as a synthesis or index that complements the classic information delivery where details about an object are often scattered in different modules/chapters/sessions.

The representations use the FL notation. They have already been loaded into the WebKB-2 knowledge base. Statements are in the courier font. They are enclosed within the XHTML marks <KR> and </KR> to permit WebKB-2 to distinguish them from regular text.   To browse from one of the categories below, copy-paste its identifier (term with '#' inside) into the following textbox or use the provided hyperlinks. Then, use the search options at the end of each displayed page.
   

Reminder: statements of the form "CONCEPT1 subtype: CONCEPT2 CONCEPT3" should be read:
"CONCEPT1 has for subtype CONCEPT2 and CONCEPT3" (in other words, any instance of CONCEPT1 is also an instance of CONCEPT2 and CONCEPT3). For relations other than "subtype" and "supertype", "CONCEPT1 RELATION1: CONCEPT2 CONCEPT3, RELATION2: CONCEPT4;" should be read: "any CONCEPT1 may have for RELATION1 one or many CONCEPT2" and "any CONCEPT1 may have for RELATION1 one or many CONCEPT3" and "any CONCEPT1 may have for RELATION2 one or many CONCEPT4".


Table of contents


Lingo scripts and related objects

Lingo#scripting_language
  input of: is#Macromedia_Director_MX,
  annotation: "scripting language used by Macromedia_Director_MX"
              "Lingo scripts usually specify an action in response to an event, e.g.
                 on mouseUp me
                   sound.beep(1)
                 end"
              "Director always executes script statements starting with the first statement 
               and continues in order until it reaches the final statement or a statement 
               that instructs a script to go somewhere else"
              "the order in which statements are executed affects the order in which you 
               should place statements"
              "if you write a statement that requires some calculated value, you need to
               put the statement that calculates the value first"
              "in the following example, the second statement could not be placed before
               the first statement because the variable x has not yet been defined:
                 x = 2 + 2
                 y = x + 2",
  purpose: "enhancing interactivity"  "controlling the sequence"
           "giving enhanced control over multimedia data"
           "giving precise positioning of sprites" 
           "performing underlying calculations"
           "allowing the use of lists (data arrays)"
           "managing and manipulating text / access external text" 
           "communicating with external programs" "providing powerful oop, etc.",
  object: Lingo#object,
  part: Lingo#handler,
  language of: Lingo#script, 
  url: http://en.wikipedia.org/wiki/Lingo_programming_language 
       http://www.tutorialfind.com/tutorials/macromedia/lingo/
       http://www.vtc.com/products/directormx2004lingo.htm ;


  Lingo#object  supertype: is#instance_of_first_order_class,
    subtype: Lingo#sprite_or_frame,
    attribute: Lingo#property ;

    Lingo#sprite_or_frame
      subtype: {Lingo#sprite  Lingo#frame};

    Lingo#property
      definition: "attributes that define an object",
      example: "for a sprite: width, height, background/foreground colours, etc.";

  Lingo#script
    subtype: {Lingo#behaviour_script  Lingo#cast_script  Lingo#movie_script};

    Lingo#behaviour_script  supertype: is#object_script,
      subtype: {Lingo#frame_behaviour_script  Lingo#score_behaviour_script},
      annotation: "executed when the sprite it is applied to is active or when a specific
                   frame is shown"
                  "new behaviours can be created from scratch by writing Lingo routines and 
                   predefined behaviours in the behaviour library"
                  "by default, the keyword 'me' appears next to the hander name",
      object of: Lingo#sprite_or_frame,
      part: Lingo#handler;

    Lingo#cast_script  supertype: is#class_script,
      annotation: "executed when respective castmember is active on the stage",
      part: Lingo#handler;

    Lingo#movie_script  supertype: is#global_script,
      part: Lingo#handler;


  Lingo#Director_xtra  supertype: is#plug_in,
    definition: "xtras are special code segments used to control external elements
                 or increase the list of available features",
    use: "to further enhance Director's functionality in Lingo",
    example: "e-mail control, networking or special transition effects",
    annotation: "there are many third party developers of xtras"
                "xtras are written in C or C++";


Events

Lingo#event  supertype: #event,
  definition: "action occurring while a movie is playing",
  annotation: "all events in Director are predefined, and always have the same meaning",
  subtype: Lingo#movie_event  Lingo#frame_event  Lingo#sprite_event  Lingo#tick_event;

  Lingo#movie_event
    subtype: Lingo#startmovie  Lingo#stopmovie;

  Lingo#frame_event
    subtype: Lingo#prepareframe  Lingo#enterframe  Lingo#exitframe;

    Lingo#prepareframe annotation: "called before the current frame is drawn";
    Lingo#exitframe    annotation: "called when current frame has been drawn";

  Lingo#sprite_event
    subtype: Lingo#mouseenter  Lingo#mouseleave  Lingo#mousedown  Lingo#mouseup 
             Lingo#beginsprite  Lingo#keyDown  Lingo#keyUp;

    Lingo#mouseenter   annotation: "called when cursor enters the sprite";
    Lingo#mouseleave   annotation: "called when cursor leaves the sprite";
    Lingo#mousedown    annotation: "called when left mouse button pressed over a sprite";
    Lingo#mouseup      annotation: "called when left mouse button  released over a sprite";
    Lingo#beginsprite  annotation: "called when sprite is created";


  Lingo#timer  supertype: #timer,
    definition: "a free running timer that counts time in ticks",
    annotation: "the timer property is useful for determining the amount of time
                 passed since the starttimer command was issued",
    agent of: Lingo#timing_process;  

    Lingo#timing_process  
      output: Lingo#tick_event,
      parameter: Lingo#starttimer,
      object: Lingo#tick;

      Lingo#tick  supertype: #time_unit,
        definition: "a basic time unit in Director",
        annotation: "1 tick = 1/60 of a second"
                    "counting ticks begins from the time the computer is started",
        object of: Lingo#the_tick;


Functions and handlers within scripts

Lingo#handler  supertype: #subroutine,
  definition: "sets of statements within a script that are run in response to
               a specific event and subsequent message",
  annotation: "when an event occurs, Director generates and sends a corresponding message
               to scripts, and a corresponding handler runs in response to the message",
  subtype: {Lingo#predefined_handler  Lingo#user_defined_handler}
           Lingo#event_handler  Lingo#function,         
  input: Lingo#message  Lingo#parameter;

  Lingo#predefined_handler
    subtype: Lingo#starttimer  Lingo#symbol_method;

    Lingo#starttimer
      purpose: "sets the timer property to 0 and resets all the accumulating timers";

  Lingo#event_handler  annotation: "starts with 'on' finishes with 'end'";

  Lingo#function
    subtype: Lingo#predefined_function  Lingo#user_defined_function,
    purpose: "returns a value or instructs a movie to do something while it is playing", 
    annotation: "a function uses the keyword 'return' to return is result, as in 
                   on findcolor
                     return sprite(1).forecolor 
                   end "
                "a function returning a result must use parentheses after its name when
                 it is called from another handler, as in 'put findcolor()' or 'beep(3)'";


  Lingo#message  supertype: #message,
    definition: "a notice that Director sends to a script when a specific event occurs in a movie",
    example: "an enterframe message when the enterframe event occurs";

  Lingo#parameter  supertype: is#subroutine_parameter,
    definition: "placeholder to pass a value to a handler",
    annotation: "if more than one parameter is passed, they are separated by commas";


Statements, expressions and operators

Lingo#statement
  subtype: Lingo#control_statement  Lingo#command,
  definition: "valid instruction that Director can execute",
  annotation: "all scripts are made up of sets of statements",
  part: Lingo#expression;

  Lingo#control_statement
    subtype: Lingo#if_statement  Lingo#case_statement  Lingo#repeat_statement;

    Lingo#if_statement   
      syntax: "if STATEMENTS then STATEMENTS [else STATEMENTS [else if STATEMENTS]] end if",
      annotation: "if the condition is true, the statements following 'then' are executed,
                   otherwise, the statements following 'else' or 'else if' are executed";

    Lingo#case_statement
      annotation: "a shortcut to using if...then ...else structures"
                  "when setting up multiple branching structures, the case and 
                   switch...case structures are often more efficient and easier to
                   read than many if...then...else structures";

    Lingo#repeat_statement
      subtype: Lingo#repeat_with  Lingo#repeat_while ;

      Lingo#repeat_with
        use: "useful for performing the same operation on a series of objects";

      Lingo#repeat_while
        use: "to repeat a set of instructions as long as a specific condition exists";

  Lingo#expression  
    definition: "any part of a statement that produces a value",
    example: "2 + 2",
    part: Lingo#operator  Lingo#basic_syntactic_unit  Lingo#list;

    Lingo#operator  supertype: #operator,
      definition: "calculate a new value from one or more values",
      subtype: Lingo#arithmetic_operator  Lingo#comparison_operator 
               Lingo#logical_operator  Lingo#string_operator
               Lingo#linear_list_operator  Lingo#property_list_operator;

       Lingo#arithmetic_operator  annotation: '+' '-' '*' '/';
       Lingo#comparison_operator  annotation: '<' '>' '=';
       Lingo#logical_operator     annotation: 'not' 'and' 'or';
       Lingo#string_operator      annotation: '&' '&&';

       Lingo#linear_list_operator
         annotation: 'listname.getat(list, position)'
                     'listname.setat(list, ordernumber, value)'
                     'listname.addat(list, position, value)'
                     'listname.deleteat(list, number)' 
                     'listname.deleteone(list, value)'
                     'listname.count (list)'           'listname.getone(list, value)'
                     'listname.getpos(list, value)'    'listname.sort(list)'
                     'listname.add(linearlist, value)' 
                     'listname.append(list, value)'    'listname.listp(item)',
         example: "age.addat (3, 32)"; 

       Lingo#property_list_operator
         annotation: 'listname.getprop(list, property)'  'listname.getpropat(list, index)' 
                     'listname.getaprop(list, item)'
                     'listname.setprop(list, property, newvalue)'
                     'listname.setaprop(list, listproperty, newvalue)' 
                     'listname.addprop(list, property, value)'
                     'listname.deleteprop(list, item)',
         example: "age.getprop ('jun')"; 


Lingo basic syntactic units

Lingo#basic_syntactic_unit  supertype: #language_unit,
  subtype:  Lingo#symbol  Lingo#constant  Lingo#keyword  Lingo#variable  Lingo#list;

  Lingo#symbol
    definition: "a symbol is a string or other value that begins with the hash (#) sign",
    annotation: "symbols are user-defined constants. comparisons using symbols can usually
                 be performed very quickly, providing more efficient code"
                "symbols cannot contain spaces or punctuation"
                "can be generated by the symbol method () as in 
                 'x = string(#novice)' which results in 'novice'";

  Lingo#keyword   definition: "reserved word that have a special meaning",
                  example: 'on' 'end'; 

  Lingo#constant  definition: "elements whose values do not change",
                  example: 'true' 'false' 'space' 'tab' 'empty' 'return';

  Lingo#variable
    definition: "element used to store and update values",
    annotation: "must start with a letter, an underscore (_), or the dollar sign ($);
                 subsequent characters can also be digits (0-9)"
                "the equals (=) operator must be used for assigning values to 
                 variables or change the values of many properties",
    subtype: Lingo#local_variable  Lingo#global_variable  Lingo#me  Lingo#the_tick;

    Lingo#local_variable
      annotation: "variables declared in a procedure are local to it"
                  "a local variable exists only as long as the handler in which 
                   it is defined is running";

    Lingo#global_variable  annotation: "when declared as global (for whole movie)";

    Lingo#me
      use: "within a method of a behavior object, refers to that object, as in
            'me.spritenum', 'put sprite(me.spritenum).member' and
            'put sprite(me.spritenum).member.name'",
      annotation: "the term me is used by convention (no predefined meaning in Lingo)";


  Lingo#list  supertype: sumo#list,
    definition: "ordered set of values used to track and update an array of data",
    annotation: "contain any type of data including integer/floating values, string,
                 other variables/lists",
    subtype: Lingo#linear_list  Lingo#property_list,
    example: '[1, 4, 2]'  '[#jun:19, #mary: 32, "John":43]'; 

    Lingo#linear_list   output of: Lingo#linear_list_operator;

    Lingo#property_list  output of: Lingo#property_list_operator;


Other syntax-related elements

Lingo#comment  supertype: #annotation,   
  syntax: "preceded by double hyphens (--)",
  purpose: "making it easier to understand or remember the design of a procedure"
           "comment markers can also be used to comment out sections of code for
            testing/debugging purposes",
  annotation: "each line of a comment that covers multiple lines must be preceded by
               double hyphens"
             "the content of comments can be any string"
              "adding many comments does not increase the size of your movie file when
               saved as a compressed dcr or dxr file";

Lingo#line_continuation_symbol  supertype: #symbol,
  annotation: "this symbol ('\'), used before a cariage return, means that the following
               line is interpreted as if it was on the same line";

Lingo#character_space  supertype: sumo#character,
  annotation: "spaces within expressions and statements are ignored; in strings of
               characters surrounded by quotation marks, they are not ignored";

Lingo#case_sensitivity  supertype: is#case_sensitivity,
  annotation: "Lingo syntactic unit are not case-sensitive, except for literal strings";

Lingo#syntax  supertype: #syntax,
  subtype: Lingo#verbose_syntax  Lingo#dot_syntax;

  Lingo#verbose_syntax  example: "set the loch of sprite 1 to 100"
                                 "put 100 into the loch of sprite 1";
  Lingo#dot_syntax  example: "sprite(1).loch = 100";