1 Reply Latest reply on Dec 7, 2011 10:16 AM by Flex harUI

    Drag and Drop InputTextField Problem


      Hi all, I have a question about dragging and dropping a text input field.


      I have two textinputfields, and when I ctrl click, I want to drag them to a new location. This part works, however when I click in the textinputfields after I have dragged them they snap back to their original location.


      This is so frustrating! Can someone explain this behaviour to me? I want the textfields to stay where I dragged them! PLease help!


      Flash builder code below


      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"


                                       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"




                                    protected function init():void





                                    protected function dragText(e:MouseEvent):void







                                    protected function releaseText(e:MouseEvent):void



                                              e.target.x = e.target.x;

                                              e.target.y = e.target.y;







                          <!-- Place non-visual elements (e.g., services, value objects) here -->


                <s:BorderContainer id="bannerContent" width="100%" height="100%" borderVisible="false">


                                    <s:LinearGradient rotation="90">

                                              <s:GradientEntry id="backTopColor" color="#000000"/>

                                              <s:GradientEntry id="backBottomColor" color="#000000"/>





                                    <s:TextInput y="51" x="21" color="#FFFFFF" text="Drag Me Around" borderVisible="false" contentBackgroundAlpha="0.0" fontSize="80" toolTip="Click text to edit, CTRL + click to move" mouseDown="dragText(event)" mouseUp="releaseText(event)"/>

                                    <s:TextInput y="108" x="21" color="#FFFFFF" text="Drag me around too!" borderVisible="false" contentBackgroundAlpha="0.0" fontSize="26" toolTip="Click text to edit CTRL + click to move" mouseDown="dragText(event)" mouseUp="releaseText(event)"/>