ya.. i tried that also created one more textInput field in canvas2 but
theres warning

 Error #1009: Cannot access a property or method of a null object
reference.
        at ex2/dragCompleteHandler()[D:\FlexProjects\DateInput\src\ex2.mxml:
95]
        at ex2/__mytext_dragComplete()[D:\FlexProjects\DateInput\src\ex2.mxml:
106]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks
\projects\framework\src\mx\core\UIComponent.as:9051]
        at mx.managers.dragClasses::DragProxy/mouseUpHandler()[E:\dev\3.0.x
\frameworks\projects\framework\src\mx\managers\dragClasses
\DragProxy.as:552]


On Dec 2, 12:01 pm, "Vinod M. Jacob" <[EMAIL PROTECTED]> wrote:
> In this code you have only one text inputfield.You need create another text
> input field.
> Did you mean the same ?
>
>
>
> On Tue, Dec 2, 2008 at 11:54 AM, subha <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I want to drag text from one text input field and drop it in other
> > text input field..
> > i can drag text from input field but not able to paste in textInput
> > field.. anyone help me
>
> > <?xml version="1.0"?>
> > <!-- dragdrop\DandDImageCopyMove.mxml -->
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> >    layout="horizontal">
>
> >    <mx:Script>
> >        <![CDATA[
> >                import mx.controls.TextInput;
> >                import mx.controls.Text;
> >            import mx.managers.DragManager;
> >            import mx.core.DragSource;
> >            import mx.events.DragEvent;
> >            import flash.events.MouseEvent;
>
> >            public var globeText:String;
>
> >            private function mouseOverHandler(event:MouseEvent):void
> >            {
> >                var dragInitiator:TextInput=TextInput
> > (event.currentTarget);
> >                var ds:DragSource = new DragSource();
> >                ds.addData(dragInitiator, "txt");
> >                var TextProxy:TextInput = new TextInput();
> >                TextProxy.text = globeText;
> >                TextProxy.height=10;
> >                TextProxy.width=10;
> >                DragManager.doDrag(dragInitiator, ds, event,
> >                    TextProxy, -15, -15, 1.00);
> >            }
>
> >            private function dragEnterHandler(event:DragEvent):void {
> >              if (event.dragSource.hasFormat("txt"))
> >                DragManager.acceptDragDrop(Canvas
> > (event.currentTarget));
> >            }
> >            private function dragOverHandler(event:DragEvent):void
> >            {
> >                if (event.dragSource.hasFormat("txt")) {
> >                    if (event.ctrlKey) {
> >                        DragManager.showFeedback(DragManager.COPY);
> >                        return;
> >                    }
> >                    else {
> >                        DragManager.showFeedback(DragManager.MOVE);
> >                        return;
> >                    }
> >                }
>
> >                DragManager.showFeedback(DragManager.NONE);
> >            }
>
> >            private function dragDropHandler(event:DragEvent):void {
> >              if (event.dragSource.hasFormat("txt")) {
> >                  var draggedText:TextInput =
> >                    event.dragSource.dataForFormat('txt') as
> > TextInput;
> >                  var dropCanvas:Canvas = event.currentTarget as
> > Canvas;
> >                  var newText:Text=new Text();
> >                  newText.text = draggedText.text;
> >                  newText.x = dropCanvas.mouseX;
> >                  newText.y = dropCanvas.mouseY;
> >                  dropCanvas.addChild(newText);
> >              }
> >            }
>
> >            private function dragCompleteHandler(event:DragEvent):void
> > {
> >                var draggedText:TextInput =
> >                    event.dragInitiator as TextInput;
> >                var dragInitCanvas:Canvas =
> >                    event.dragInitiator.parent as Canvas;
>
> >                if (event.action == DragManager.MOVE)
> >                    dragInitCanvas.removeChild(draggedText);
> >            }
> >        ]]>
> >    </mx:Script>
> >  <!-- Canvas holding the Text control that is the drag initiator. -->
> >    <mx:Canvas
> >        width="250" height="500"
> >        borderStyle="solid"
> >        backgroundColor="#DDDDDD">
>
> >    <!-- The Text control is the drag initiator and the drag proxy. --
>
> >    <mx:TextInput id="mytext" text="abc" mouseMove="mouseOverHandler
> > (event);" dragComplete="dragCompleteHandler(event);"/>
> >    </mx:Canvas>
>
> >    <!-- This Canvas is the drop target. -->
> >    <mx:Canvas
> >        width="250" height="500"
> >        borderStyle="solid"
> >        backgroundColor="#DDDDDD"
> >        dragEnter="dragEnterHandler(event);"
> >        dragOver="dragOverHandler(event);"
> >        dragDrop="dragDropHandler(event);" >
> >    </mx:Canvas>
> > </mx:Application>- Hide quoted text -
>
> - Show quoted text -

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