Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9176873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:12:26+00:00 2026-06-17T17:12:26+00:00

I have a component that is draggable. However, it cannot be dragged if the

  • 0

I have a component that is draggable. However, it cannot be dragged if the user drags while the mouse is on the text field. How can I set the Text field so the user can click-drag on that part of the interface?

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"  creationComplete="init()" width="210" height="150" styleName="noteStyle" >
<mx:Script>
    <![CDATA[
        public var testId:int;
        public var buttonNumber:int;
        public function init():void{
            this.addEventListener(MouseEvent.MOUSE_DOWN, makeDraggable)
            this.addEventListener(MouseEvent.MOUSE_UP, endDrag)
            this.buttonMode = true;
            this.useHandCursor = true;
        }
        public function saveButtonHandler():void{
            dispatchEvent(new Event  ( "noteClosed"));
        }
        public function cancelButtonHandler():void{
            dispatchEvent(new Event  ( "noteCancelled"));
        }
        public function makeDraggable(e:Event):void{
            //If the target and the current target are the same, then it must be the background, so make it draggable.
            //Stops the text field and buttons from being draggable
            trace("Target= "+e.currentTarget+" "+e.target)
            if(e.currentTarget==e.target){
                this.startDrag();
            }
        }
        public function endDrag(e:Event):void{
            this.stopDrag();
        }
    ]]>
</mx:Script>
    <mx:Text  text="Add a note: Drag to move"   styleName="myriadPro14"   selectable="false"   />
    <mx:Button  id="saveButton" label="Save" x="146" y="120" click="saveButtonHandler()" />
    <mx:Button  id="cancelButton" label="Cancel" x="10" y="120" click="cancelButtonHandler()"  />
    <mx:TextArea id="noteText" width="200" height="80"     horizontalCenter="0" verticalCenter="-12"/>
</mx:Canvas>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:12:27+00:00Added an answer on June 17, 2026 at 5:12 pm

    Add an event listener to the text field as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom component that I can place in my layout file (XML) for
I have draggable items that can be cloned. I wanted each clone to be
I have a component that I want to show/hide after user hits a commandButton
In Java Swing, do we have text component that will work just like how
I have a component that requires .NET 4.0 to run, how can my Inno
I have a TImage component that I print a Text string to using TCanvas.TextOut().
I have a Component that uses MigLayout as its LayoutManager. It is set to
I have a component that I hand over a function public var func :
I have a component that is made up of various components such as a
I have a component that i want to store to an SQLite database. public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.