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

  • SEARCH
  • Home
  • 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 3351550
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:55:21+00:00 2026-05-18T01:55:21+00:00

Simple drag and drop application where mc is dragged out of one parent mc

  • 0

Simple drag and drop application where mc is dragged out of one parent mc and dropped into another parent mc.
All works OK until I added 2 text boxes to the mc’s — one is a non-selectable dynamic text box (a label) which is set by the code, the other is selectable input text that the user can amend.

The text boxes cause some problems:

  1. Finger cursor disappears when user hovers over the section of the mc that contains the text fields (even non-selectable text??)
  2. When the user trys to drag the mc by inadvertantly click-dragging anywhere within both text areas it causes this error: TypeError: Error #1034: Type Coercion failed: cannot convert flash.text::TextField@2374a381 to flash.display.MovieClip (same error appears for both text boxes)
  3. The input text box may confuse the user – how do they sometimes click to drag and sometimes click to amend? I’m thinking the input text needs to be clearly a non-click-drag ‘zone’ in the mc. (hope that makes sense)

Not sure, but maybe I need to create an overlay area within the mc that is click-detected for the drag?
Any other suggestions?

Here’s the relevant bits of code:

var itemArray:Array = [
                    {iname:"police",ititle:"POLICE OFFICER"},
                    {iname:"insurance_assessor",ititle:"INSURANCE ASSESSOR"},
                    {iname:"estimator",ititle:"ESTIMATOR"}
                    ];
for (var i:int=0; i < itemArray.length; i++) 
{ 
 var itemname:String = itemArray[i].iname;
 var curritem:MovieClip = MovieClip(scrollitems.getChildByName(itemname)); 
 if (curritem != null) 
 { 
   curritem.ititle.text = itemArray[i].ititle;
   curritem.addEventListener(MouseEvent.MOUSE_DOWN, pickUp); 
   curritem.addEventListener(MouseEvent.MOUSE_UP, dropIt); 
   curritem.buttonMode = true; 
 }
}

function pickUp(event:MouseEvent):void
{
  var dragIt:MovieClip = MovieClip(event.target);   //type casting
  var dragPoint:Point = dragIt.parent.localToGlobal(new Point(dragIt.x,dragIt.y));
  dragIt.parent.removeChild(dragIt); // remove item from current parent mc
  stage.addChild(dragIt); //temp add to stage
  dragIt.x = dragPoint.x;
  dragIt.y = dragPoint.y;
  dragIt.startDrag();
}
  • 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-05-18T01:55:21+00:00Added an answer on May 18, 2026 at 1:55 am

    The problem that you have is that the Textfields are mouseEnabled. The label field mouseEnabled property should be set to false , as for the other TextField I can think of two solutions.

    • The simpler approach (as you already mention ) could be to create a draggable hitArea within your mc , similar to the top of a window on a desktop , you could add your event listeners to this area so that the mc can only be dragged from there.

    • A second approach could be to set your mc’s mouseChildren property to false on a MouseDown and back to true on a MouseUp. This shouldn’t interfere with a user entering text in your input textfield.

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

Sidebar

Related Questions

I want to implement some simple drag & drop into my Mac application. I
I am working on a Windows Forms Application. During one Drag and Drop action
Recently I've been looking into adding a simple HTML5 drag and drop to my
=I am trying to develop a simple drag/drop UI in my web application. An
I'm implementing drag and drop QTreeView based on my custom model. All works fine,
I am initiating drag and drop from my WinForms application using this simple IDataObject
I have a simple test example that works fine, I set the drag/drop properties
I want to do a simple drag-drop using jQuery. I have not done anything
I have a very simple application test in which I want to drag and
I know it's a simple question, but I can't seem to drag it out

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.