Hello Everyone,

 

I really need your help understanding the Drop of the Drag & Drop.  I am trying to ‘drop’ an image from a ‘tileList’ onto a canvas, but I am having issues with creating the child in the canvas.  I am very new to ActiveScript and Flex, and I’m sorry if this has been covered.

 

Here is the drop code:

----------------------------------

 

function doDragDrop(event) {

          doDragExit(event);

          var item = event.dragSource.dataForFormat("product");

          Alert.show(item[0], "Alert Box",Alert.OK);

         

          if (item != undefined) {

                   item.mapX = event.target.mouseX - item.mouseInitX;

                   item.mapY = event.target.mouseY - item.mouseInitY;

          }

 

          cvsPage.createChild(mx.controls.Image,"newTxtFld"+item, {x:'xLoc', y:'yLoc'});

 

}

 

---------------------------------

 

As you can see, I have taken some sample code and I’m trying to apply it my needs (learning by example), but I have no idea where I am going wrong.  I am having a hard time finding an example of dragging an image from a list and dropping (creating) on a canvas.

 

Additional Questions

------------------------------

Why am I not getting a value to display in the alert box?

What does the dataForFormat(“STRING”) refer to?  Is this just an arbitrary name?

*****

dataForFormat( format: String) :  Object

format: String - Sting that specifies a label that describes the format for the data to return. This parameter is required.

*****

 

Many thanks for the help in advance.

 

~David T.

 



Yahoo! Groups Links

Reply via email to