# Reorder string text line actionscript 3

**URL:** <https://forum.kirupa.com/t/reorder-string-text-line-actionscript-3/332361>\
**Category:** Uncategorized\
**Created:** [May 8, 2014, 8:48pm UTC](https://forum.kirupa.com/t/reorder-string-text-line-actionscript-3/332361 "2014-05-08T20:48:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Badaoui](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Mustafa\_Badaoui](https://forum.kirupa.com/u/Mustafa_Badaoui)\
**Post date:** [May 8, 2014, 8:48pm UTC](https://forum.kirupa.com/t/reorder-string-text-line-actionscript-3/332361/1 "2014-05-08T20:48:18Z")

</div>

Hello world !  
[COLOR=#404040][FONT=Roboto]i need help please ![/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]On this pic of an swf flash , i want to inverse the string :[/FONT][/COLOR]

[COLOR=#404040][FONT=Roboto]Hello google plus [/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]I need Help ![/FONT][/COLOR]

[COLOR=#404040][FONT=Roboto]The inversion works well , but the text lines aren’t on the correct order !! [/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]Any one can help me ! [/FONT][/COLOR]

i need reorder the output like that :

i ! sulp elgoog olleH

! pleH deen  
[COLOR=#404040][FONT=Roboto]  
[/FONT][/COLOR][SIZE=6][COLOR=#ff0000][FONT=Roboto]This my actionscript 3 code :[/FONT][/COLOR][/SIZE]

* * *

[COLOR=#404040][FONT=Roboto]import flash.events.Event;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]input\_txt.text ="";[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.text ="";[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var timer:Timer = new Timer(2000);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]timer.addEventListener(TimerEvent.TIMER, onTimer);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]//[/FONT][/COLOR]-------------------------------  
[COLOR=#404040][FONT=Roboto]test.addEventListener(MouseEvent.CLICK, reverseMessage);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]er.addEventListener(MouseEvent.CLICK, earseMessage);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto][//myField.background](https://myField.background) = false;[/FONT][/COLOR]

[COLOR=#404040][FONT=Roboto]output\_txt.selectable =false;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]function earseMessage(event:MouseEvent):void[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]{[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]input\_txt.text ="";[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.text ="";[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]}[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]function reverseMessage(event:MouseEvent):void[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]{[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto][//timer.start](https://timer.start)();[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]/_[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var textInput:String = input\_txt.text;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.background = true;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.backgroundColor = 0xffff00;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var inputArr:Array = textInput.split("");[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]inputArr.reverse();[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var reverseStr:String = inputArr.join("");[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.text = reverseStr;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]System.setClipboard(output\_txt.text);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto][//System.setClipboard](https://System.setClipboard)(myField.text);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]_/[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]}[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]function onTimer(evt:TimerEvent):void[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]{[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]//output\_txt.background = false;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto][//timer.stop](https://timer.stop)();[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]}[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]addEventListener(Event.ENTER\_FRAME,copy\_Text)[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]function copy\_Text(event:Event):void[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]{[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var textInput:String = input\_txt.text;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.background = true;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.backgroundColor = 0xffff00;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var inputArr:Array = textInput.split("");[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]inputArr.reverse();[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]var reverseStr:String = inputArr.join("");[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]output\_txt.text = reverseStr;[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]System.setClipboard(output\_txt.text);[/FONT][/COLOR]  
[COLOR=#404040][FONT=Roboto]}

[/FONT][/COLOR]
