ActionScript 3.0 :: Cannot Get The Carriage Returns And Tabs Stripped From XML
Dec 22, 2009
why i cannot get the carriage returns and tabs stripped from my XML. I guess the only drawback at this point is that i cannot form my xml file nicely and am stuck placing all my node text on one line.
So far here is what i have tried without any luck;
ActionScript Code:
var subXml:XML = new XML();
subXml.ignoreWhitespace = true;
subXml = new XML(e.target.data);
[Code].....
I am otherwise at a loss as to why it's leaving the tabs returns etc. in my textFields when i populate them with the node data.
In Flash I load the text content of the title attribute into a text field, problem is -- the prints instead of operating as a carriage return (new line).
Again, no access to the XML so changing the TextField to htmlText and adding a <br/> tag wont work.
I am simply wanting to stop a user entering carriage returns in a TextArea. I have been experimenting with the 'restrict' property in the TextArea but cant seem to work it out.I have the following code:
<mx:Canvas id="cvs1" label="Panel 1" width="100%" height="100%" creationComplete"addEvtListnerOnPlaceText()" backgroundColor="#FFFFFF"> <mx:TextArea id="txtP1T1" x="10" y="176" text="{placeName}" width="210" textAlign="center" color="#DC0000" restrict="this is where I need some help"/> </mx:Canvas>
I've now managed to get something working:
private function addEvtListnerOnPlaceText():void{ txtP1T1.addEventListener(KeyboardEvent.KEY_DOWN, onKeyEventDown); txtP1T1.addEventListener(KeyboardEvent.KEY_UP, onKeyEventUp);
[code]....
The only issue now is that if you hold return down, it clears the first carriage return and then keeps adding as long as you hold it down. I need a way to stop this happening without just losing focus on the text area.
I've got an app where I'm grabbing the currently highlighted text from the user in a RichEditableText block and I've noticed that when the user highlights a selection after a carriage return that selectionActivePosition and selectionAnchorPosition return values that don't count the carriage return, even though when I slice the corresponding text with the retrieved values, it does take the carriage return into account and therefore returns a value shifted one character to the left for each carriage return appearing earlier in the text.
it's possible to restrict hard returns in text input fields? I've tried something like this:my_txt.restrict="^u0013", and a bunch of variations thereof, but nothing seems to keep the Enter key from doing it's thing. Second best would be to traverse through a string a user has entered and replace hard returns with a space or dash, but again I've had no luck looking for or . I've tried entering text and hard returns into a dynamic textfield set to input, but when I try this:
var n:Number = my_txt.indexOf(" ")... trace("n: "+n) //traces "n: -1"
I am trying to connect to some web service on server to get a RSS feed.It connects to the web service on the server. But then afterwards, it strips the port number of the URL. For example:But then, when I try to call a method of that web service it says:o the port is stripped from the URL, can anybody tell me why this might be?I have tried connecting to this service on my local network with the same port number, then it works fine, port number not stripped
I have a load file and a write to file method. We all know what they do. How ever load always returns true and write always returns false....Right there you know somethings wrong. Because The forums have an issue with me posting code...I posted it here: [URL] Based on this code what is the issue here? why is write always returning false and why is load always returning true? (even for files that do not exist). My understanding is that if flash cannot find the file it should write to it will create it and if it cant load said file, then that method should return false.
I'm having with a menu navigation system. I'm using Flash MX. I have created a menu system for the site I'm building ([URL]) where one of the buttons "Choose photographer" drops down a list of names. All the other buttons just jump to another page. The drop down is currently using tweens also the logo moves to the left as the dropdown appears and returns when the dropdown returns. All working fine apart from its a bit jerky.
It's I just wanted to get away from tweening and use action scripts instead, as I'm a newbie to all things Flash I trawled the net for tutorials and examples so that I could cobble together the exact same effect. I have managed to get the drop down work and return using the action script and it does seem smoother and works slightly better. But can I get the logo to move to the left and back in time with the drop down...no.
How can I get the text from the textarea component along with the line feed & carriage return characters?
As now, I amusing the text to send email. But in email, it showing all in a line rather than multiline, which means carrriage return and/or line feed characters are missing. How can get them?
How do I convert a multiline of text from an input box into a single line of text except I would put a string of characters to replace the carriage return?
I am developing an admin panel for an flash site. One of the sections contains large amount of text containing Carriage Returns. It can look as this : John Doe was born in Athens in 1974. He studied at the Athens School of Fine Arts and he presented his first solo exhibition in 1996.
So from the text area the text goes to mysql and from mysql I generate an XML file. The problem is the xml file source is looking like this : John Doe was born in Athens in 1974. He studied at the Athens School of Fine Arts and he presented his first solo exhibition in 1996.
This way in flash the text has some big spaces between phrases and I dont like it. How to generate XML file to be like this : John Doe was born in Athens in 1974. He studied at the Athens School of Fine Arts and he presented his first solo exhibition in 1996.
If it's possible to restrict hard returns in text input fields? I've tried something like this: my_txt.restrict="^u0013", and a bunch of variations thereof, but nothing seems to keep the Enter key from doing it's thing. Second best would be to traverse through a string a user has entered and replace hard returns with a space or dash, but again I've had no luck looking for or I've tried entering text and hard returns into a dynamic textfield set to input, but when I try this: var n:Number = my_txt.indexOf(" ")... trace("n: "+n) //traces "n: -1"
How to remove a carriage return that's inserted mysteriously by flash. I have a text input box and it auto adds a enter key press carriage return. <IMAGE Names="Josh ">My imputed text</IMAGE></GALLERY> %20Names%3D%22Josh%26%23xD%3B%22%3EMy imputed text%3C%2F This is the mess of crap its auto inserting %26%23xD%3B%22%3E
myNews=<FONT COLOR="#FFFFFF"><B>This is bold 24 point text</B><P></P><P></P>blah blah</FONT>
As i could read on macromedia 's web site:Use an empty pair of <P></P> tags to insert a line break. Use two pairs to insert a line break and carriage return.But this isn't working.
I have an input TextField and have a KeyboardEvent.KEY_DOWN even listener on the stage to listen for the Keyboard.ENTER event. The event listener adds the entered text to an array or whatever, and then clears the TextField. The problem is that when the Enter key event fires and the TextField value is set to "", it leaves a carriage return in the TextField and the cursor positioned on the second line. WTF? I've been coding AS2 and AS3 for a LONG time and have never ran into this before.Example:
var myTextArray:Array = new Array(); stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); function onKeyDown(e:KeyboardEvent):void{
I'm kind of new to flash, and I'm working in CS3 AS3. Here is my code. - Home is my button instance name
[Code]...
Now, _top, _self, I can't get anything to work for what I want to do. What I'm trying to do is make it so when I click a link, it opens it in the SAME tab. I have seen many (dozens) of these problems, but none seem to help. On firefox, it openes in a new tab, (I have it set so windows open in new tabs), on IE it opens in a new window, and in chrome it opens in a new tab. Please help me fix this problem,
how to put tabs in application using only actionscript, there are lot of examples there using flex mx controls for tabnavigator, but i want to use only actionscript or flashscript.
I am fairly new to flash and I have started to attempt to modify a template that I found online to make it my own. The thing that I am having problems with is the URL Links. There are 5 different clickable tabs on the header that I have, and when you edit it in flash cs4, each one is the same image when you edit it. The only way in which you can change what each one of them says is by editing them in the library. This isn't the problem. I want to link these tabs to different pages on my website. When I edit one of them, all of them change to the same url link. The file is too large for me to upload I think.
I can't really understand how can Adobe let the developers release such a messy embedded Flash editor. Please, fix the line copying, it drives me mad. In every normal editor, when u get to the start of the line and press shift+downarrow, the whole line is selected. Flash selects the tabs in the next line also. So pasting is a horrible nightmare.
In a tab navigator, I need to find out the x and y coordinates of each the tabs. Is there a way to do that? I am using HBox as Tab in the TabNavigator.
Im loading tabs for an accordion control at runtime. The number of tabs is determined by the role of the user. Each tab comes from a module so the load time is variable. As a result the list order changes every time the app is run.Is there a practical way to sort the tabs as each new tab is loaded?
I'm loading an xml file in AS3/Flex for an AIR app. When I save it, the indenting looks pretty, however all the tabs from the original file, are now spaces. Can I save to that the tabs remain?
open file code:
var file:File = event.target as File; var fileStream:FileStream = new FileStream(); fileStream.open( file, FileMode.READ );
I'm trying to maintain a web applications state across multiple tabs whilst using ActionScript, JavaScript, and PHP. Should I use AJAX to update the database after an item has been purchased etc, or should I prevent the game being loaded if it's already open in a single tab (if so how could I achieve this)?
I'm building a facebook game, when the user buys an item and has many open tabs it doesn't update the state in the other open tabs. The buying of an item is handled by ActionScript, and the storage of that item is dealt with using PHP.
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs.
My problem is the look and feel. How do I get the list to have a similar look and feel to the horizontal tab bar? Is it a case of overriding skins? I have found this post: Flex 4 vertical TabBar
which does implement vertical tabs. My problem with this is that I do not get any text in the tab. I think the problem is that this was originally written for flex 2. I am using flex 4 and am trying to put this component inside a