User Guide
colorDepth 699
If you try to set a monitor’s color depth to a value that monitor does not support, the monitor’s
color depth doesn’t change.
On computers with more than one monitor, the
colorDepth property refers to the monitor
displaying the Stage. If the Stage spans more than one monitor, the
colorDepth property
indicates the greatest depth of those monitors;
colorDepth tries to set all those monitors to the
specified depth.
Example
This statement tells Director to open the movie Full color only if the monitor color depth is set to
256 colors:
-- Lingo syntax
if (_system.colorDepth = 8) then
window("Full color").open()
end if
// JavaScript syntax
if (_system.colorDepth == 8) {
window("Full color").open()
}
The following handler tries to change the color depth, and if it can’t, it displays an alert:
-- Lingo syntax
on tryToSetColorDepth(desiredDepth)
_system.colorDepth = desiredDepth
if (_system.colorDepth = desiredDepth) then
return true
else
_player.alert("Please change your system to" && desiredDepth && "color \
depth and reboot.")
return false
end if
end
// JavaScript syntax
function tryToSetColorDepth(desiredDepth) {
_system.colorDepth = desiredDepth;
if (_system.colorDepth == desiredDepth) {
return true;
}
else {
_player.alert("Please change your system to " + desiredDepth +
" color depth and reboot.");
return false;
}
}
See also
System