# Draggable Textfield Problem \[Flash MX 2004\]

**URL:** <https://forum.kirupa.com/t/draggable-textfield-problem-flash-mx-2004/218440>\
**Category:** flash\
**Created:** [March 7, 2007, 7:31pm UTC](https://forum.kirupa.com/t/draggable-textfield-problem-flash-mx-2004/218440 "2007-03-07T19:31:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpdematteo](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@gpdematteo](https://forum.kirupa.com/u/gpdematteo)\
**Post date:** [March 7, 2007, 7:31pm UTC](https://forum.kirupa.com/t/draggable-textfield-problem-flash-mx-2004/218440/1 "2007-03-07T19:31:16Z")

</div>

Hi,

How can you force a draggable textfield to behave like a regular one after it’s been moved?

When I release the mc that holds the textfield, the whole text block is highlighted in black. I can overwrite what’s in the textfield but I can’t select a specific insertion point for the cursor. I want to be able to add more text or make changes, not just redo the whole text block.

I have a button with the following code on the timeline:

\_root.btn\_CreateText.onRelease = function() {[INDENT]makeText(\_root.mc\_Model.mcTextBox);[/INDENT]}

This is the function it calls:

function makeText(mc:MovieClip):Void {[INDENT]mc.createTextField(“txtQuestion”,1,0,0,500,0);[/INDENT][INDENT]mc.txtQuestion.setNewTextFormat(new TextFormat(“Arial”, 16, 0x000066));[/INDENT][INDENT]mc.txtQuestion.type = “input”;[/INDENT][INDENT]mc.txtQuestion.multiline = true;[/INDENT][INDENT]mc.txtQuestion.wordWrap = true;[/INDENT][INDENT]mc.txtQuestion.text = “Type your question here.”;[/INDENT][INDENT]mc.txtQuestion.autoSize = “left”;[/INDENT]}

To make the textfield draggable, I used this code:

this.mc\_Model.mcTextBox.onPress = function():Void {[INDENT]moveText(this);[/INDENT]}

The function is:

function moveText(mc:MovieClip){[INDENT]nLevel++;[/INDENT][INDENT]mc.startDrag(false, 20, 50, 635, 280);[/INDENT][INDENT]mc.\_alpha = 50;[/INDENT][INDENT]mc.swapDepths(nLevel);[/INDENT][INDENT]mc.onRelease = function() {[INDENT]stopDrag();[/INDENT][INDENT]Selection.setFocus(mc.txtQuestion);[/INDENT]}

[/INDENT]}

What am I missing? Can anyone help me out?

Thanks!
