Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

flipping string's as3 iOS app

im using actionscript 3 to program my app, which includes hebrew characters. The user enters these characters in an input box which then displays the characters on screen - however by default they are displayed backwords. I use a simple function that flips the string. This all works well once i debug the app on my pc, but once i publish the app and use it on my iphone, the textbox never displays the flipped string.


I narrowed it down and used the app in different version - it works fine without the reversing of the string, but once I enter the code that reverses the string (it can be english/hebrew chars) it doesnt work correctly.


The reversing code is this : (user enters string in the textbox inputtxt)


newstring = inputtxt.text.split("").reverse().join("");


^

for some reason this line of code does not work in the app itself, but while debugging and testing it on the pc it does work.

Posted on Jun 13, 2012 8:43 AM

Reply
5 replies

Jun 13, 2012 11:33 AM in response to Jongware

technically it flips both of them...

however it does not display neither of the english/hebrew flipped text


what im saying is that if i debug it on my pc and add a trace(newstring) cmd , i get the flipped string


but for example if i run it on my iphone and have a cmd that is :

textbox.text = inputtxt.text.split("").reverse().join("");


^ - that textbox will not display the text no matter in what language

Jun 13, 2012 12:52 PM in response to royhermann

So ... the entire Hebrew part of the story was just a red herring? No matter what, it won't flip anything?


There could be subtle differences in Actionscript, and if a long, concatenated command does not work, first thing to do is write it out in its most simple form, with debug statements between each line. You might find, for example, that split("") does not work, or reverse, or the final join. It's even possible that on their own the three commands work (and you get your flipping string) but that it fails when combined with one of, or both of the other commands.


If *exactly the same line* works in any other environment, it sounds more like a local AS bug than an oversight on your end.

Jun 13, 2012 1:48 PM in response to Jongware

ive expiremented now and im even getting wierder results...i flipped the string in a different way not using those previous methods (using for loops this time), and the textbox's are not displaying the flipped string yet again..

i am still sucesfully getting flipped outputs when i use the trace method but the textbox itself is not willing to display the flipped string...


this is all done on an iOS as3 enviornment in Flash 6...can you check if a similar simple project works for you?

flipping string's as3 iOS app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.