attachEvent Method

Attaches the specified function to the given SGWorld event.

attachEvent(sEvent, fpNotify);

 

Parameter

Description

sEvent

The name of the event generating the call

fpNotify

The function to call when the event fires

Remarks

For a list of Skyline Globe Control events, see SGWorld Events.

Example

The following example illustrates the use of the attachEvent method.

var globe = null;

 

function init()

{

   try

   {

      globe = new SGWorld();

      globe.attachEvent(“onLButtonUp”, myOnLButtonUp);

   }

   catch(e)

   {

      alert(e.description);

   }       

}

function myOnLButtonUp(flags,x,y)

{

   alert(“Left button up at: “ + x + “,“ + y);

}