ActionScript 3.0 :: Can't Seem To Get Newlines With SetClipboard()
Feb 23, 2012
I have lines of code in a text field:
blah1();
blah2();
blah1();
[Code].....
Everything in this code works except tmpTxt2 += " "; for some reason. I've tried as well. I've tried looking for solutions online, but am getting a lot of XML and html solutions that I don't think will work for this.
View 0 Replies
Similar Posts:
Apr 1, 2007
I'm trying to use System.setClipboard.This copies text to the clipboard.My problem is that it doesn't copy the newline character.I've tried using and but it still doesn't work.
Here is some sample code I'm using:
PHP Code:
myText.text = "Kirupa Website" + newline + "Flash Samples" + newline "Flash Forums"; System.setClipboard(myText.text);
I've also tried having 2 newline characters to seperate the text... but the same results happens.There is no paste function in Flash apparently for security reasons...So to test... you have to use something like Notepad or any other text editor.
View 10 Replies
Aug 11, 2010
Just to be clear, in order for System.setClipboard() to work, it has to be executed within a function that receives either a Keyboard or Mouse Event. Now, in my specific case, I need to hack this so that when I press 'enter', I get my string that I want to paste into the clipboard from the internet, and when Flash gets it, THEN it pastes it in.Here's an example on how I thought I could do that (unfortunately I didn't work).
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyboardHandler);
function keyboardHandler(e:KeyboardEvent):void {
[code].....
View 5 Replies
Aug 6, 2010
Any thoughts on a good way to accomplish something along the lines of
var request:URLRequest = new URLRequest("http://myurl.com");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, function(event:Event):void {
System.setClipboard(loader.data);
});
It seems as if System.setClipboard() isn't available inside an event handler (which makes at least some sense given what I know about Flash security).get it to work? or block on the URL load so that I can then call setClipboard() in the main event flow?
View 1 Replies
Apr 9, 2011
I unserstand security restrictions about working with clipboard. The user must do an action then clipboard may be written.
But what if on mouseclick i have to load some text from server using URLRequest and copy obtained data to clipboard?
Like this:
protected function clickHandler(e:MouseEvent):void
{
this.fileReference = new FileReference();
this.fileReference.addEventListener(Event.SELECT, this.fileSelectHandler);
[Code]....
View 2 Replies
Nov 13, 2009
I have an array filled with random values and some have newlines. How can I search through this array and erase only the newline values
View 0 Replies
Aug 8, 2011
I'm having a problem with a game I have been creating: when the user saves, a function copies text from a textarea to an xml document. However when the save is loaded, the textarea appends the saved text as if it had no newlines. A strange thing I found was that when I loaded the xml save file and added a character or space to part of the saved text and then load it again from the game, the newlines would be present.This has been bugging me for a while since it's the very last part I need to finish the game engine. I was wondering how I can overcome this by somehow letting flash know where to take newlines.
View 3 Replies
Jan 10, 2005
when a user writes something down in a inputTextfield (in a compleet flash page) and presses enter (make a newline)how are the newlines then formated ?
with
"
" , "
" or "
" ?
is it crossbrowser ? the reason i ask is that i save the data in a Mysql database and when the data return to flash i see "" in the debugger so, i think flash uses the "" newline format, but before i add the data into the database i want to parse the data with php
View 4 Replies
Dec 27, 2010
I'm attempting to parse newlines from pasted text from the clipboard into a single-lined TextField. I'd like to replace the newlines with ' ' (or any other delimiter) in the text field and have it submit text with newlines (' ' delimiter would suffice, as that's automatically parsed within my message box already).
Is there any method I could use to go about this?
View 1 Replies
Jan 10, 2011
I'm trying to find the number of newlines in a string using the Actionscript 3.0 RegExp engine. Using the string.match function and RegExp(" ","g") does not find the newlines in a string which contains newlines. Is there something I need to add to the pattern or something else that I am missing?
View 1 Replies
May 19, 2010
I am using multi line text input in flash. Predefined text it sends as it is. I application when i edit text and send there are no new line. All text comes in single line.
View 1 Replies
Oct 4, 2008
I have the following composition from my designer:
So, I have to load these two HTML paragraphs from an XML file and put them in two actionscript created text fields. The text fields are multiline, wrapped and html and they are displayed just fine. Then I have to hilight one of the textfields just like in the image above so I must define a function that takes this textfield as an argument and creates a movieclip behind it. All I have to do further is draw some lines in this movieclip.
The problem is I just can't detect the newline characters in the text field so I can draw the hilights from the start of each line to the end of it.
Here is my function:
function hilight(sapou_txt){
var hilight_mc = sapou_txt._parent.createEmptyMovieClip("hilight_mc",-1);
hilight_mc._x = -5;
hilight_mc._y = sapou_txt._y;}
There would be .indexOf("") method of strings but if I use it after sapou_txt.text this has no result because, apparently, all I have there is a string without any special newline characters, just as I loaded it from the XML file, minus HTML tags.
If I use sapou_txt.htmlText apparently I get the original text including the HTML tags but, again, no special newline characters and, as you probably realised from my description above, I need both newlines from HTML (wich are not so hard to detect) and newlines caused by wrapping text in the textfield. Anyway, if I succeed in detcting newlines in the text field then I won't need the newlines in my original HTML.
View 4 Replies
Oct 3, 2003
Slice seems to disregard any <br> and/or newlines. IE, when I slice() a string from a certain position, and transfer the sliced string to a new dyn. text box, all enters etc get lost; all text appears on one line.
View 4 Replies