EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 260

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
260 Chapter 12: Methods
Example
This statement displays the ASCII code for the letter A:
put ("A").charToNum
-- 65
The following comparison determines whether the letter entered is a capital A, and then navigates
to either a correct sequence or incorrect sequence in the Score:
-- Lingo syntax
on CheckKeyHit theKey
if (theKey).charToNum = 65 then
go "Correct Answer"
else
go "Wrong Answer"
end if
end
// JavaScript syntax
function CheckKeyHit(theKey) {
if (theKey.charToNum() == 65) {
go("Correct Answer");
} else {
go("Wrong Answer");
}
}
See also
numToChar()
clearAsObjects()
Usage
-- Lingo syntax
clearAsObjects()
// JavaScript syntax
clearAsObjects();
Description
Command; resets the global Flash Player used for ActionScript objects and removes any
ActionScript objects from memory. The command does not clear or reset references to those
objects stored in Lingo. Lingo references will persist but will refer to nonexistent objects. You
must set each reference to
VOID individually.
The
clearAsObjects() command affects only global objects, such as the array created in
this statement:
-- Lingo syntax
myGlobalArray = newObject(#array)
// JavaScript syntax
myGlobalArray = new Array();
The clearAsObjects() command has no effect on objects created within sprite references, such
as the following:
myArray = sprite(2).newObject(#array)

Related product manuals