Hi All,
I have an accordion, which consists of a set of images. I wanna be
able to drag and drop them onto a Panel. Once i drop them i want to be
able to display the image on the panel at the point where i drop them.
All through this, the images in the accordion should remain as it is.
Could someone please tel me hw to do this? I know about the drag and
drop part. But i am not able to display the images on the panel once i
drop them on the panel (networkStage). Please look at my handleDrop()
function :

public function handleDrop(dragEvent:DragEvent):void{

        //var dragInitiator:Image = dragEvent.dragInitiator;
        var dragInitiator:Image = dragEvent.dragSource.dataForFormat('img')
as Image;

        var dropTarget:Panel = dragEvent.currentTarget as Panel;

                var img:Image = new Image();
                img.source = dragInitiator.source;


        //Alert.show(" You dropped the rectangle on the screen");

                 /* Image(dragEvent.dragInitiator).x =
                    Panel(dragEvent.currentTarget).mouseX;

                Image(dragEvent.dragInitiator).y =
                    Panel(dropTarget).mouseY;*/


                img.addEventListener(MouseEvent.MOUSE_UP,
                function(event:MouseEvent):void{

                        img.x = event.currentTarget.mouseX;
                        img.y = event.currentTarget.mouseY;
                        img.width = dragInitiator.width;
                        img.height = dragInitiator.height;

                        this.networkStage.rawChildren.addChild(img);

                                });


                /* dragEvent.dragInitiator.x = dragEvent.localX;
                dragEvent.dragInitiator.y = dragEvent.localY;  */

        }

The parts of code that have been commented are the different ways that
i tried to solve the problem, but to no use.


-- 
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.

Reply via email to