Hi all,
I cannot able to resize an image while i drag and drop.. Drag and drop
alone works fine.. but if i do Resize using a resizehandler i cannot
able to provide a soruce property from the xml i use to load the
images..
I am having a tile list and a canvas.. from tile list i m dropping
images to Canvas.. and Inside canvas i wanna do drag and drop, resize
and rotate of the image...
in the examples i saw they have given the source for the image (after
drop) directly.. but i cannot do so.. i don know how to take it from
my XML...
here is my XML... and my COde...
<?xml version="1.0" encoding="utf-8"?>
<embellishments>
<image title="embellishment1"
thumbnailImage="assets/embellishments/thumb/cat1.jpeg"/>
<image title="embellishment2"
thumbnailImage="assets/embellishments/thumb/cat2.jpeg"/>
<image title="embellishment3"
thumbnailImage="assets/embellishments/thumb/dog1.jpeg"/>
<image title="embellishment14"
thumbnailImage="assets/embellishments/thumb/penguin.jpeg"/>
<image title="embellishment5"
thumbnailImage="assets/embellishments/thumb/tweety"/>
</embellishments>
Code::
public function doDragStart(event:MouseEvent):void
{
var dragInitiator:Image = event.currentTarget as
Image;
var dragSource:DragSource = new DragSource();
var dragProxy:Image = new Image();
dragProxy.source = dragInitiator.source;
dragProxy.width = dragInitiator.width;
dragProxy.height= dragInitiator.height;
dragSource.addData(event.localX, "localX");
dragSource.addData(event.localY, "localY");
DragManager.doDrag(dragInitiator, dragSource, event,
dragProxy);
}
private function doDragEnter(event:DragEvent):void
{
DragManager.acceptDragDrop(UIComponent(event.target));
}
private function doDragDrop(event:DragEvent):void
{
var img:Image = new Image();
if (event.dragInitiator.parent == dropCanvas)
{
//
Alert.show(event.dragSource.formats.toString());
img = event.dragInitiator as Image;
var obj:ObjectHandles = new ObjectHandles();
obj.resizeHandleImage = resize_handle;
var image:Image = new Image();
image.source =" " /// i don know how to
parse my XML and
put the dragged items path of the image here....
obj.addChild(image);
dropCanvas.addChild(obj);
}
Thanks in advance...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---