Loading ...
Sorry, an error occurred while loading the content.

Re: Using array notation to create drag/drop objects

Expand Messages
  • rocketeerbkw
    ... started ; ... Thank you very much, that definitely helps solve that problem. In the code I posted i had //ttFdrg[i].hide(); The reason it s commented out
    Message 1 of 4 , Apr 30 8:16 PM
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
      > Don't try to use the reference to the array item in the body of the
      > startDrag function. Use "this" instead:
      >
      > for (var i=1; i<=3; i=i+1) {
      > mnFdrg[i].startDrag = function (x, y) {
      > this.addToGroup("Alias2");
      > this.addToGroup("Alias3");
      > this.addToGroup("Alias4");
      > this.removeFromGroup("Alias1");
      > YAHOO.util.Dom.get('status').innerHTML = this.id + " drag
      started";
      > }
      > }
      >
      >
      > -Adam
      >

      Thank you very much, that definitely helps solve that problem. In the
      code I posted i had //ttFdrg[i].hide();
      The reason it's commented out was because it was giving me the same error.
      The reason I'm calling that is because it is a reference to a tooltip,
      and i want it to go away whenever someone starts dragging.
      ttFdrg[1] = new YAHOO.widget.Tooltip("ttFdrg1", {context:"mnFdrg1",
      text:"<img src=\"images/thumbnails/thumb1.gif\" />", showDelay:200});

      if I can't use "this" how can I reference that?
    Your message has been successfully submitted and would be delivered to recipients shortly.