Make Dynamic Text Draggable

Hi all,

I have a game where the user inputs text and this text is shown on different scenes.

I used the following code, where ‘input1_txt’ is the input text box and ‘output1_txt’ is the dynamic text box where it is displayed:


textenter_btn.addEventListener(MouseEvent.CLICK,textdisplay);
var enteredText:String = "";



function textdisplay(event:MouseEvent){
    enteredText = input1_txt.text; 
    output1_txt.text = enteredText;
}


Later in the game, in a separate scene, I use the following code to display the original user input text in a dyamic text box called ‘input2_txt’:




input2_txt.text = enteredText;

This may not be the best way to have done this, but it works.

My question to you all is - how can I make it so that the second dynamic text box is draggable by the user? i.e. they can drag and drop the original input text at this later scene.

startDrag and stopDrag don’t work for dynamic text as far as I’m aware - so I was wondering if someone could help me out.

Cheers :cowboy: