SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Lacking scope

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Feb 2008
    0 Post(s)
    0 Thread(s)

    Lacking scope

    Hi all,

    I can't figure out why the alertDraggable function does have access to the this variable (refering to the object instance), and the onClick function (invoked from within the VE API) doesn't. I appreciate your advise.

    ULAB.GeoCMS.Core.Shape = Class.extend({
        initialize: function(type, points) {
            this.veShape = new VEShape(type, points);
            this.locked = true;
            this.previousLocation = null;
            this.draggable = true;
            this.core = ULAB.GeoCMS.Core.Register.getEntry('core');
   = core.getMap();
  "onclick", this.onClick);
        alertDraggable: function() {
             alert(this.draggable); //true
        onClick: function() {
             alert(this.draggable); //undefined
    Note: the code uses the inheritance model as described at:

    Thanks in advance!
    Last edited by ulab; Feb 25, 2008 at 07:15.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts