Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 90000

Re: Pls Help! Drag and Drop problem, identical symbols acting differently - same code! WHY?

$
0
0

Hi James,

 

I haven't looked at the handlers properly, but I see that there is a lot of code duplication. You can replace the code from line 42 till 332 with the following:

 

risk.forEach(function(r) {

// apply the draggable JQuery UI plugin to the MyDraggableSymbol symbol on your stage

  sym.$(r).draggable({

  start: function(e){},

  drag: function(e,ui)

  {

  sym.getSymbol(r).stop("Initial");

  sym.setVariable("symName",r);

  }

  }

  );

 

  //adding for risk3_orange similarly add for other symbols

  sym.$(r).draggable();

  sym.getSymbol(r).$(r).bind('click tap',function(ev) {

   sym.$(r).draggable('disable');

  }).unbind('dblclick taphold',function(ev) {

   sym.$(r).draggable('enable');

  });

});

 

Assuming that your handlers are setup correctly, it should work the same way for all the instances.

 

Regards,

Dharmendra


Viewing all articles
Browse latest Browse all 90000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>