I am doing where a person can enter some text into a input text box.. It is multiline.. What I want to happen is the user can us # to do to the next line.. test # test will be test test Can anyone help me with this..
If its written in php you can always try the $variable = str_replace("#","<br>" $variable); would that work? You have to be more specific and less abstract
I don't think that would be easy with Flash. For Multi-line fields its usually Enter that Works in Flash. I'll ask Some friends about this and let you know.
There is not a imple solution within flash because ActionScript Doesnt have simple replace function. Here is a simple function replace any text var my_str:String = "One#Two#Three#Four"; function replace_txt(my_str:String) { var my_new_str:String = ""; var my_arr:Array = my_str.split("#"); //You can change the character or string you want to use a a breaker for (i=0; i<my_arr.length; i++) { my_new_str += my_arr[i]+newline; } return my_new_str; } my_txt.text = replace_txt(my_str); // my_txt text field Code (markup):
I am going to show you guys and example of what I am talking about.. http://www.adultcomments.net/Generators/Grunge-Heart/grungeheartgen.swf They use * to do a Hard Return.. I cant find that anywhere.. To learn how to do that at all..
I visited the example. unfortunately, This is not a place to explain all the functionalities of that app. But if you want to see how to swap "*" with a linebreak, please use following function. var my_str:String = "One#Two#Three#Four"; function replace_txt(my_str:String) { var my_new_str:String = ""; var my_arr:Array = my_str.split("*"); //You can change the character or string you want to use a a breaker for (i=0; i<my_arr.length; i++) { my_new_str += my_arr[i]+newline; } return my_new_str; } my_txt.text = replace_txt(my_str); // my_txt text field Code (markup):
ok This is what I have.. //this is the variable for the dynamic box var text = "Make your changes, copy to get your code!!" //if the text on the Input box is changed this event is called var my_str:String = ""; function replace_txt(my_str:String) { var my_new_str:String = ""; var my_arr:Array = my_str.split("*"); //You can change the character or string you want to use a a breaker for (i=0; i<my_arr.length; i++) { my_new_str += my_arr[i]+newline; } return my_new_str; } iText.text = replace_txt(my_str); // my_txt text field iText.onChanged = function() { _root.text = "<center><font size='-1'><a href='http://www.mateable.com/'>Giving a new definition to love and friendship</a></font><br><embed src='" + lnpath + "vday.swf' FlashVars='&ms=" + ms + "' quality='high' wmode='transparent' width='385' height='380' name='Christian Bible' align='middle' allowScriptAccess='samedomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /><a href='" + lnpath + "'>" + linktext + "</a></center>"; } Code (markup): I have two text boxes.. one is dynamic Text Var ms and instance Name iText the other is input Text with the same VAR and Instance Name.. When i type in the input box it puts it on the dynamic Text so If i type in * it wont do anything..
You have made many mistakes from naming to refering, and many things. I just uploaded the corrected version at http://www.srilankaexpedition.com/christian_biblegen.rar