Lingo Dictionary > L-N > me |  |

me

Syntax

    me

Description

Special variable; used within parent scripts and behaviors to refer to the current object that is an instance of the parent script or the behavior or a variable that contains the memory address of the object.

The term has no predefined meaning in Lingo. The term `me` is used by convention.

To see an example of `me` used in a completed movie, see the Parent Scripts movie in the Learning\Lingo Examples folder inside the Director application folder.

Example

This statement sets the object `myBird1` to the script named Bird. The `me` keyword accepts the parameter script Bird and is used to return that parameter.

    myBird1 = new(script "Bird")

This is the `on new` handler of the Bird script:

    on new me
    	return me
    end

Example

The following two sets of handlers make up a parent script. The first set uses `me` to refer to the child object. The second set uses the variable `myAddress` to refer to the child object. In all other respects, the parent scripts are the same.

This is the first set:

    property myData

    on new me, theData
    	 myData = theData
    	return me
    end

    on stepFrame me
    	ProcessData me
    end

This is the second set:

    property myData

    on new myAddress, theData
    	myData = theData
    	return myAddress
    end

    on stepFrame myAddress
    	ProcessData myAddress
    end

See also

`new()`, `ancestor`