DISCLAIMER: Please understand that this document is incomplete and may contain errors. The file was originally created as internal engineering reference material and has since grown into a useful document for all. Sometime during the Spring or Summer of 2004 we hope to complete this document (or rather complete a set of object model documentation), remove any erroneous material and then post everything to the macromedia.com website, most likely in the Developer's or Support Centers, maybe both. If you find any missing or incorrect properties and methods within the objects listed in this document then please feel free to contact me (Tom Higgins, don't forget to remove the nospam_) directly so I can make the appropriate changes. Please do NOT write me indicating objects that are not listed in this document (I'm aware of them and working on entering them), please do NOT write me asking when it will all be complete (it'll be done as soon as I can get to it! :) ). The only time to write me in reference to this document is when an object is listed and is missing information or has incorrect information shown. Sorry to be stern about that but I don't want any excess email traffic, thanks. Keep an eye on the revision history as I'll make sure to outline any and all updates that are made over time.

Tom Higgins - Product Specialist, Director Team
macromedia

 

Director Object Model (DOM)

Introduction

The Big Picture

Top Level Properties
Top Level Functions

Player Object
     Movie Object
          Cast Object
               Member Object
          Sprite Object
          Sprite Channel Object
     Window Object

Global Object

Key Object

Mouse Object

Sound Object
     Sound Channel Object

System Object

Definitions

Revision History

 

. . .

 

Introduction

This document describes the object model that will be exposed to both Lingo and ECMAScript code within Director, projectors and the Shockwave player. It is helpful to think of ECMAScript within Director as sitting on top of the pre-existing animation engine and Lingo language, and as such it inherits the object and event models from Director. The discussion begins with a high-level view of the object model structure followed by some top level property definitions and then the core object definitions. At the end of this document is a section for discussing open issues and a revision history. This document covers the core functions, properties and objects built within the player engine. As such, this document does not discuss the top-level properties and methods nor the cast member or sprite properties and methods introduced by specific media types that are supported in Director.

Throughout this document you will see table entries colored orange, these entries are deprecated Lingo that will no longer be documented nor actively supported. Support for these commands will remain in the player engine so as not to break pre-existing content, but these commands or properties will not be updated going forward so as to include new functionality. We recommend that developers begin migrating to the new syntax elements sooner as opposed to later.

Here are a few helpful references regarding our implementation of ECMAScript support in Director MX 2004:

 

return to top

 

The Big Picture

 

return to top

 

Top Level Properties

  Property   Description   Comments  
 
_global
:
refers to the Global object used to store/access global variables   new to MX2004  
 
_key
:
refers to the Key object used to access keyboard functionality   new to MX2004  
 
_menuBar
:
refers to the MenuBar object installed by the player's installMenu() method   new to MX2004  
 
_mouse
:
refers to the Mouse object used to access mouse functionality   new to MX2004  
 
_movie
:
refers to the currently active Movie object   new to MX2004  
 
_player
:
refers to the Director Player object   new to MX2004  
 
_sound
:
refers to the Sound object used to access sound functionality   new to MX2004  
 
_system
:
refers to the System object   new to MX2004  

 

return to top

 

Top Level Functions

  Function   ECMAScript Syntax   Lingo Syntax   Comments  
  castLib()   castLib(stringCastLibName)   castLib(stringCastName)      
      castLib(integerCastLibNum)   castLib(integerCastNum)      
          castLib stringCastName      
          castLib integerCastNum      
  channel()   channel(channelNumber)   channel(channelNumber)   new to MX2004  
      channel(channelName)   channel(channelName)      
  color()   color(integerPaletteIndex)   color(integerPaletteIndex)   new to MX2004  
      color(integerRed,integerGreen,integerBlue)   color(integerRed,integerGreen,integerBlue)      
  date()       date(stringFormat)      
          date(integerFormat)      
          date(intYearFormat,intMonthFormat,intDayFormat)      
  image()   image(intWidth,intHeight,intBitDepth)   image(intWidth,intHeight,intBitDepth)      
  list()   list()   list()      
          []      
      list(value,value,value,...)   list(value,value,value,...)      
          [value,value,value,...]      
  member()   member(memNameNum{,castNameNum})   member(memNameNum {,castNameNum})      
          member memNameNum      
          member nameNum of castLib nameNum      
  propList()   propList()   propList()      
          [:]      
      propList(string,value,string,value,...)   propList(string,value,string,value,...)      
          propList(symbol,value,symbol,value,...)      
          [#symbol:value,#symbol:value,...]      
  put()   put(value)   put(value)      
          put value      
  point()   point(integerH,integerV)   point(integerH,integerV)      
  random()   random(integerA {,integerB})   random(integerA {,integerB})      
  randomVector()   randomVector()   randomVector()      
  rect()   rect(intLeft,intTop,intRight,intBottom)   rect(intLeft,intTop,intRight,intBottom)      
  script()   script(memNameNum {,castNameNum})   script(memNameNum {,castNameNum})      
  showLocals()   - not available : Lingo only -   showLocals()      
  sound()   sound(intSoundChannel)   sound(intSoundChannel)      
  soundBusy()   soundBusy(intSoundChannel)   soundBusy(intSoundChannel)      
  sprite()   sprite(channelNameNum)   sprite(channelNameNum)      
      sprite(stringChannelName)   sprite(stringChannelName)      
          sprite intChannelNum      
  symbol()   symbol(stringValue)   symbol(stringValue)      
  timeout()   timeout(timeoutObjName)   timeout(timeoutObjName)      
  trace()   trace(displayString)   trace(displayString)   new to MX2004  
  vector()   vector()   vector()      
      vector(intX,intY,intZ)   vector(intX,intY,intZ)      
  window()   window(stringWindowName)   window(stringWindowName)      
  xtra()   xtra(integerXtraNum)   xtra(integerXtraNum)      
      xtra(stringXtraName)   xtra(stringXtraName)      
                 
                 
                 
          paletteIndex(integer)   replaced by color() above  
          rgb(intRed,intGreen,intBlue)   replaced by color() above  
          tell   direct access now available  
          xtra integerXtraNum   use _player.scriptingXtraList[]  

 

return to top

 

 

Cast Object

properties
indexed properties
methods

Properties   ECMAScript Syntax   Lingo Syntax   Comments  
  fileName   castRef.fileName   castRef.fileName      
          the fileName of castRef      
  name   castRef.name   castRef.name      
          the name of castRef      
  number   castRef.number   castRef.number      
          the number of castRef      
  preLoadMode   castRef.preLoadMode   castRef.preLoadMode      
          the preLoadMode of castRef      
  selection   castRef.selection   castRef.selection      
          the selection of castRef      
                 
Indexed Properties   ECMAScript Syntax   Lingo Syntax      
  member[]   castRef.member[stringMemberName]   castRef.member[stringMemberName]   new to MX2004  
      castRef.member[integerMemberNum]   castRef.member[integerMemberNum]   new to MX2004  
                 
Methods   ECMAScript Syntax   Lingo Syntax      
  findEmpty()   castRef.findEmpty( {memberRef} )   castRef.findEmpty( {memberRef} )      
          castRef.findEmpty( {memberRef} )      

Related Objects:
Director Player Object
Movie Object
Window Object
Sprite Object

Sprite Channel Object
Member Object

 

return to top

 

 

Global Object

properties
methods

Properties   ECMAScript Syntax   Lingo Syntax   Comments  
                 
          version   use _player.productVersion  
                 
Methods   ECMAScript Syntax   Lingo Syntax      
  clearGlobals()   _global.clearGlobals()   _global.clearGlobals()      
          clearGlobals()      
          clearGlobals      
  showGlobals()   _global.showGlobals()   _global.showGlobals()      
          showGlobals()      
          showGlobals      

 

return to top

 

 

Key Object

properties
methods

Properties   ECMAScript Syntax   Lingo Syntax   Comments  
  commandDown   _key.commandDown   _key.commandDown      
          the commandDown      
  controlDown   _key.controlDown   _key.controlDown      
          the controlDown      
  key   _key.key   _key.key      
          the key      
  keyCode   _key.keyCode   _key.keyCode      
          the keyCode      
  optionDown   _key.optionDown   _key.optionDown      
          the optionDown      
  shiftDown   _key.shiftDown   _key.shiftDown      
          the shiftDown      
                 
Methods   ECMAScript Syntax   Lingo Syntax      
  keyPressed()   _key.keyPressed()   _key.keyPressed()      
      _key.keyPressed(keyCodeOrCharacter)   _key.keyPressed(keyCodeOrCharacter)      
          keyPressed(keyCodeOrCharacter)      
          the keyPressed      
                 

 

return to top

 

 

Member Object

properties
methods

Properties   ECMAScript Syntax   Lingo Syntax   Comments  
  castLibNum   memberRef.castLibNum   memberRef.castLibNum      
  comments   memberRef.comments   memberRef.comments      
  creationDate   memberRef.creationDate   memberRef.creationDate      
  fileName   memberRef.fileName   memberRef.fileName      
  height   memberRef.height   memberRef.height      
  hilite   memberRef.hilite   memberRef.hilite      
  linked   memberRef.linked   memberRef.linked      
  loaded   memberRef.loaded   memberRef.loaded      
  media   memberRef.media   memberRef.media      
  mediaReady   memberRef.mediaReady   memberRef.mediaReady      
  modified   memberRef.modified   memberRef.modified      
  modifiedBy   memberRef.modifiedBy   memberRef.modifiedBy      
  modifiedDate   memberRef.modifiedDate   memberRef.modifiedDate      
  name   memberRef.name   memberRef.name      
  number   memberRef.number   memberRef.number      
  purgePriority   memberRef.purgePriority   memberRef.purgePriority      
  rect   memberRef.rect   memberRef.rect      
  regPoint   memberRef.regPoint   memberRef.regPoint      
  scriptText   memberRef.scriptText   memberRef.scriptText      
  size   memberRef.size   memberRef.size      
  thumbnail   memberRef.thumbnail   memberRef.thumbnail      
  type   memberRef.type   memberRef.type      
  width   memberRef.width   memberRef.width      
                 
Methods   ECMAScript Syntax   Lingo Syntax   Comments  
  copyToClipBoard()   memberObjectReference.copyToClipBoard()   memberObjectReference.copyToClipBoard()      
          copyToClipBoard memberObjectReference      
  duplicate()   memberObjectReference.duplicate({integerPosn})   memberObjectReference.duplicate({integerPosn})      
          duplicate memberObjectReference {, integerPosn }      
  erase()   memberObjectReference.erase()   memberObjectReference.erase()      
          erase memberObjectReference      
  importFileInto()   memberObjRef.importFileInto(fileOrUrlString)   memberObjRef.importFileInto(fileOrUrlString)      
          importFileInto memberObjRef, fileOrUrlString      
  move()   memberObjRef.move({integerPosn,castLibName})   memberObjRef.move({integerPosn,castLibName})      
          move memberObjRef {, integerPosn,castLibName }      
  pasteClipBoardInto()   memberObjectReference.pasteClipBoardInto()   memberObjectReference.pasteClipBoardInto()      
          pasteClipBoardInto memberObjectReference      
  preLoad()   memberObjectReference.preLoad()   memberObjectReference.preLoad()      
      fromMemberObjRef.preLoad(toMemberObjRef)   fromMemberObjRef.preLoad(toMemberObjRef)      
  unLoad()   memberObjectReference.unLoad()   memberObjectReference.unLoad()      
      fromMemberObjRef.unLoad(toMemberObjRef)   fromMemberObjRef.unLoad(toMemberObjRef)      

Related Objects:
Director Player Object
Movie Object
Window Object
Cast Object
Sprite Object
Sprite Channel Object

 

return to top

 

 

Mouse Object

properties