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!