Package kernel

Class MacaoObject

Constructor   Methods

The class MacaoObject is the base class for every object displayed in a page. It implements basic functionality as displaying, positioning, sizing and event handling.

Because it is the basic interface to the browser's objects, it contains the majority of the browser specific code (even if there is not much brwoser specific code).

To use more complex functionality as walking and talking include the package dynamic in the page. This will extend MacaoObject with the methods and properties of the MacaoObject defined in that package.

Constructor Summary
MacaoObject(String name, String title, number left, number top)
     Use this constructor to create new objects at your page.

Method Summary
void activateDrag(boolean active, optional boolean moveBack, optional String cssClassName)
     Use this method to activate or deactivate dragging for this object and to set dragging characteristics.
void activateDrop(optional boolean active, optional String hiliteCssClassName)
     Call this method to activate or deactivate the drop functionality for this object.
void addController(String controllerObjectName)
     Use this method to set the name of an object, which is accepted as controller by this object.
void broadcastEvent(String eventType, optional Array params, optional boolean toAllFrames)
     Sends an event to all objects of the sender's frame or to all objects of all frames.
DIV createLayer()
     This method creates the DIV element (= layer), which is used to display the object. There may be only one layer for each object. If there is already a layer for this object, the existing layer is returned. See also getLayer().
MacaoLook createLook(String name, String imageSource, number baseWidth, number baseHeight, optional number deltaLeft, optional number deltaTop, optional String html)
     Use this method to create a look and add it to the list of looks, which is maintained by the object.
void displayMeasures()
     This method displays the basic measures of this object in the browser's status bar.
String getActualLook()
     This method returns the name of the look, which is currently displayed.
boolean getCollisionCheck()
     Gets the information, if collision check is turned on for this object.
String getCssClassName()
     Gets the object layer's cascading stylesheet class name.
String getFrameName()
     Gets the name of the frame, where the object is in.
integer getHeight()
     Gets the current height of the object.
DIV getLayer()
     The method return the DIV object, which is used to display the object. The DIV object is part of the HTML DOM (Document Object Model).
number getLeft()
     The method returns the position of the left edge of the object.
MacaoLook getLook(String lookName)
     Use this method to retrieve a look, which was previously added to the object.
String getName()
     Gets the name of the object. The name can be used to reach the object using events.
String getTitle()
     Use this method to get the title of the object. See also setTitle().
number getTop()
     This method returns the position of the top edge of the object.
String getType()
     Gets the type of the object.
boolean getVisibility()
     Gets the visibility of the object's layer.
integer getWidth()
     Gets the current width of the object.
integer getZIndex()
     Gets the z-index of the object's layer.
number getZoom()
     Gets the current zoom factor.
boolean hasLook(String lookName)
     Use this method to test, if a look with the specified name has been added to the object.
void initObject(String name, String title, number left, number top)
     This method initializes the properties of the object. If the package dynamic is loaded into the page, this method also calls the method initDynamic().
boolean isController(String controllerObjectName)
     Use this method to test, if another object is accepted as controller by this object.
boolean isDragActive()
     Call this method to check, if this object can be dragged by the user.
boolean isDragged()
     Call this method to check, if the object is currently being dragged.
boolean isDropActive()
     Call this method to check, if Drop is activated for this object.
boolean isDropAllowed(MacaoObject forObject)
     This method controls, if another object may be dropped to this object.
void moveTo(number left, number top)
     This method moves the object to a position on the page immediately.
void moveToCenter()
     This method moves the object so that it is horizontally and vertically centred in the frame where the page is displayed in.
void notifyControllers(String notificationType, optional variant param)
     Call this method to send a notification to all controllers, which are registered to this object.
void onClick(Event event, integer mouseX, integer mouseY)
     This event handler is called when the user clicks on the object.
void onClickOther(String objectName, Event event, integer mouseX, integer mouseY)
     This event handler is called when another object is clicked.
void onClickOtherItem(String itemName, String itemTitle)
     This event handler is called, when the user clicks at an item in a MacaoInventory.
void onClickWindow(Event event, integer mouseX, integer mouseY, String frameName)
     This event handler is called, when the mouse is clicked in any frame.
void onCollisionOut(optional String objectName)
     This event handler is called when the object starts colliding with another object.
void onCollisionOver(String objectName)
     This event handler is called, when the object ends colliding with another object.
void onDblClick(Event event, integer mouseX, integer mouseY)
     This event handler is called when the user double clicks on the object.
void onDblClickOther(String objectName, Event event, integer mouseX, integer mouseY)
     This event handler is called when another object is double clicked.
void onDblClickWindow(Event event, integer mouseX, integer mouseY, String frameName)
     This event handler is called, when the mouse is double clicked in any frame.
void onDragEnd(Event event, integer mouseX, integer mouseY)
     This method is called, when the user ends to drag this object.
void onDragOut(Event event, integer mouseX, integer mouseY, MacaoObject otherObject)
     This method is called, when the user drags this object out from over another object.
void onDragOver(Event event, integer mouseX, integer mouseY, MacaoObject otherObject)
     This method is called, when the user drags this object over another object to which it can be dropped.
void onDragStart(Event event, integer mouseX, integer mouseY)
     This method is called, when the user starts to drag this object.
void onDrop(Event event, integer mouseX, integer mouseY, MacaoObject toObject)
     This method is called, when the user drops another object to this object.
void onKeyDown(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)
     This event handler is called, when a key goes down on window level.
void onKeyPress(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)
     This event handler is called, when a key is pressed on window level.
void onKeyUp(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)
     This event handler is called, when a key goes up on window level.
void onLoad(Event event)
     This method is called when the page's loading is complete.
void onMouseDown(Event event, integer mouseX, integer mouseY)
     This event handler is called when the mouse button goes down on the object.
void onMouseDownWindow(Event event, integer mouseX, integer mouseY, String frameName)
     This event handler is called, when the mouse button goes down in any frame.
void onMouseMove(Event event, integer mouseX, integer mouseY)
     This event handler is called when the user moves the mouse pointer over the object.
void onMouseOut(event event, integer mouseX, integer mouseY)
     This event handler is called when the user removes the mouse pointer from over the object.
void onMouseOver(event event, integer mouseX, integer mouseY)
     This event handler is called when the user moves the mouse pointer over the object.
void onMouseUp(Event event, integer mouseX, integer mouseY)
     This event handler is called when the mouse button goes up on the object.
void onMouseUpWindow(Event event, integer mouseX, integer mouseY, String frameName)
     This event handler is called, when the mouse button goes up in any frame.
void onUnload(Event event)
     This method is called before the page is unloaded.
void openPage(String pageURL, optional String frameName, optional boolean forceReload)
     Opens a page in the defined frame.
MacaoEvent postEvent(String eventType, Array params, integer delay, optional String recipientName, optional String frameName)
     Sends an event to an object with a delay.
void refreshZoom()
     Call this method to refresh the size of the image, which is used to display the object.
void removeController(String controllerObjectName)
     Use this method to remove the name of an object, which is accepted as controller by this object.
void removeObject()
     This method removes the object from the list of the objects. And it removes the layer of the object from the DOM of the page.
void say(String text, optional String html, optional String imageSource, optional integer imageWidth, optional integer imageHeight, optional integer duration, optional String afterEventType, optional Array afterEventParams, optional String cssClassName, optional String lookName)
     This method displays a bubble near the object, showing a text, which is "said" by the object.
void scrollVisible()
     Scrolls the object into view.
variant sendEvent(String eventType, optional Array params, optional String recipientName, optional String frameName)
     Sends an event to an object.
void setActualLook(String lookName, optional boolean forceReload)
     Use this method to display a look, which has been added to the object.
void setBaseSize(optional integer baseWidth, optional integer baseHeight)
     Sets the base size of the object. The base size is used for calculating the zoom size.
void setCollisionCheck(boolean active)
     Activates or deactivates the collision check of the object.
void setCssClassName(optional String cssClassName)
     Set the name of the object layers cascading stylesheet class.
void setForwardMouseEvents(optional boolean active)
     Call this method to activate the forwarding of mouse events to the underlying objects.
void setHTML(String html)
     This method sets HTML to the layer.
void setImage(String imageSource, number baseWidth, number baseHeight, optional number deltaLeft, optional number deltaTop)
     Sets an image to the object.
void setScrollVisibleOptions(boolean autoScroll, integer borderDistance)
     Sets the characteristics for scrolling an object into view.
void setTitle(String title)
     This method sets the title of the object. The title is used for displays to the user. See also getTitle().
void setToolTip(optional String toolTip)
     The method sets the content of tool tip of the object. The tool tip is displayed when the user places the mouse pointer over the object. By default the title of the object is set as the tool tip content.
void setType(String type)
     Sets the type of the object. Initially the type is set by the name of the object.
void setVisibility(boolean visibility)
     Sets the visibility of the object's layer.
void setZIndex(integer zIndex)
     Sets the z-index of the object's layer.
void setZoom(number zoomFactor)
     The method sets the zoom factor for the current object.
integer toBack()
     This method drops the object behind each other on the page.
integer toFront()
     This method raises the object above each other object on the page.

Constructor Details
MacaoObject(String name, String title, number left, number top)

Method Details
void activateDrag(boolean active, optional boolean moveBack, optional String cssClassName)

void activateDrop(optional boolean active, optional String hiliteCssClassName)

void addController(String controllerObjectName)

void broadcastEvent(String eventType, optional Array params, optional boolean toAllFrames)

DIV createLayer()

MacaoLook createLook(String name, String imageSource, number baseWidth, number baseHeight, optional number deltaLeft, optional number deltaTop, optional String html)

void displayMeasures()

String getActualLook()

boolean getCollisionCheck()

String getCssClassName()

String getFrameName()

integer getHeight()

DIV getLayer()

number getLeft()

MacaoLook getLook(String lookName)

String getName()

String getTitle()

number getTop()

String getType()

boolean getVisibility()

integer getWidth()

integer getZIndex()

number getZoom()

boolean hasLook(String lookName)

void initObject(String name, String title, number left, number top)

boolean isController(String controllerObjectName)

boolean isDragActive()

boolean isDragged()

boolean isDropActive()

boolean isDropAllowed(MacaoObject forObject)

void moveTo(number left, number top)

void moveToCenter()

void notifyControllers(String notificationType, optional variant param)

void onClick(Event event, integer mouseX, integer mouseY)

void onClickOther(String objectName, Event event, integer mouseX, integer mouseY)

void onClickOtherItem(String itemName, String itemTitle)

void onClickWindow(Event event, integer mouseX, integer mouseY, String frameName)

void onCollisionOut(optional String objectName)

void onCollisionOver(String objectName)

void onDblClick(Event event, integer mouseX, integer mouseY)

void onDblClickOther(String objectName, Event event, integer mouseX, integer mouseY)

void onDblClickWindow(Event event, integer mouseX, integer mouseY, String frameName)

void onDragEnd(Event event, integer mouseX, integer mouseY)

void onDragOut(Event event, integer mouseX, integer mouseY, MacaoObject otherObject)

void onDragOver(Event event, integer mouseX, integer mouseY, MacaoObject otherObject)

void onDragStart(Event event, integer mouseX, integer mouseY)

void onDrop(Event event, integer mouseX, integer mouseY, MacaoObject toObject)

void onKeyDown(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)

void onKeyPress(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)

void onKeyUp(Event event, integer keyCode, boolean shiftKey, boolean altKey, boolean ctrlKey, String frameName)

void onLoad(Event event)

void onMouseDown(Event event, integer mouseX, integer mouseY)

void onMouseDownWindow(Event event, integer mouseX, integer mouseY, String frameName)

void onMouseMove(Event event, integer mouseX, integer mouseY)

void onMouseOut(event event, integer mouseX, integer mouseY)

void onMouseOver(event event, integer mouseX, integer mouseY)

void onMouseUp(Event event, integer mouseX, integer mouseY)

void onMouseUpWindow(Event event, integer mouseX, integer mouseY, String frameName)

void onUnload(Event event)

void openPage(String pageURL, optional String frameName, optional boolean forceReload)

MacaoEvent postEvent(String eventType, Array params, integer delay, optional String recipientName, optional String frameName)

void refreshZoom()

void removeController(String controllerObjectName)

void removeObject()

void say(String text, optional String html, optional String imageSource, optional integer imageWidth, optional integer imageHeight, optional integer duration, optional String afterEventType, optional Array afterEventParams, optional String cssClassName, optional String lookName)

void scrollVisible()

variant sendEvent(String eventType, optional Array params, optional String recipientName, optional String frameName)

void setActualLook(String lookName, optional boolean forceReload)

void setBaseSize(optional integer baseWidth, optional integer baseHeight)

void setCollisionCheck(boolean active)

void setCssClassName(optional String cssClassName)

void setForwardMouseEvents(optional boolean active)

void setHTML(String html)

void setImage(String imageSource, number baseWidth, number baseHeight, optional number deltaLeft, optional number deltaTop)

void setScrollVisibleOptions(boolean autoScroll, integer borderDistance)

void setTitle(String title)

void setToolTip(optional String toolTip)

void setType(String type)

void setVisibility(boolean visibility)

void setZIndex(integer zIndex)

void setZoom(number zoomFactor)

integer toBack()

integer toFront()