EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 874

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...
874 Chapter 14: Properties
mouseLevel
Usage
-- Lingo syntax
spriteObjRef.mouseLevel
// JavaScript syntax
spriteObjRef.mouseLevel;
Description
QuickTime sprite property; controls how Director passes mouse clicks on a QuickTime sprite
to QuickTime. The ability to pass mouse clicks within the sprite’s bounding rectangle can be
useful for interactive media such as QuickTime VR. The
mouseLevel sprite property can have
these values:
• #controller—Passes clicks only on the movie controller to QuickTime. Director responds
only to mouse clicks that occur outside the controller. This is the standard behavior for
QuickTime sprites other than QuickTime VR.
• #all—Passes all mouse clicks within the sprite’s bounding rectangle to QuickTime. No clicks
pass to other Lingo handlers.
• #none—Does not pass any mouse clicks to QuickTime. Director responds to all mouse clicks.
• #shared—Passes all mouse clicks within a QuickTime VR sprite’s bounding rectangle to
QuickTime and then passes these events to Lingo handlers. This is the default value for
QuickTime VR.
This property can be tested and set.
Example
This frame script checks to see if the name of the QuickTime sprite in channel 5 contains the
string “QTVR.” If it does, this script sets
mouseLevel to #all; otherwise, it sets mouseLevel to
#none.
-- Lingo syntax
on prepareFrame
if sprite(5).member.name contains "QTVR" then
sprite(5).mouseLevel = #all
else
sprite(5).mouseLevel = #none
end if
end
// JavaScript syntax
function prepareFrame() {
var nm = sprite(5).member.name;
var nmStr = nm.indexOf("QTVR");
if (nmStr != -1) {
sprite(5).mouseLevel = symbol("all");
} else {
sprite(5).mouseLevel = symbol("none");
}
}