Actionscript 3 :: Remove White Space At Start Of String?
Jan 10, 2012How I can remove whitespace from a string, but only if the white space is the first character?[code]...
View 2 RepliesHow I can remove whitespace from a string, but only if the white space is the first character?[code]...
View 2 RepliesI am trying to remove / replace white space from a string in as3. The string comes from xml and than written into text field. To compare the strings I am trying to remove white spaces
var xmlSentence:String=myXML.SENTENCE[thisSentence];
var tfSentence=e.target.text;
var rex:RegExp = /s+/;
trace(xmlSentence.replace(rex, "-"));
trace(tfSentence.replace(rex, "-"));
That code outputs like this:
She-has a dog
-She has a dog
I also tried different rex patterns. The problem is that though there are spaces in both string -which are same- it finds only one space but not the same one in both strings.
There is a white space above the flash file. My file is 360 pix high, but I need the default bar at the bottom. So I set it to be 400. But the extra 40 pix got shared by the bar and an unwanted white space on the top.
If I set it to 360, no space, but no bar either. In either case, there is an extra 2 pix double lines on top. I want to remove the space and double lines.
<table
class="Popup_Flash" border="0" align="center">
<tr valign="Top"><td>
[Code]....
Does anyone know how to remove the white space which shows up under Firefox when viewing your page with a flash movie and an image next/under it? With IE the flash and any images next to it butt against each other like they're supposed to, but under Firefox the white space shows up. How do you get rid of it?
View 2 RepliesI have a text file that needs to be parsed correctly. The text file looks like this:
[header]
[header 2]
[ header3 ]
I can grab these headers by doing so
var expression:RegExp = /[ [a-z0-9 ]+ ]/igxm;
var items:Array = text.match(expression);
But I would also like to remove the white space from before and after the brackets, so the headers can align against the left edge. Also, for [ header3 ], I would like to remove the white space inside the brackets, before "h" and after "3". What would be the correct regex for something this?
URL...check for WHERE YOU CAN SHOOT section theres one gallery if you click on any of the thumbnail a new broswer window opens with jpg... if u check it when jpg loads in that browser it leaves left top and bottom white space.i want to remove that white space.
View 14 RepliesI am new in Flash and Currently, I use Flash Pro CS5 to create new movies and modify old movies.
When I publish the movie I developed it comes with two white blank sides and i tried to change the Publish settings like Dimensions and Scale and publish the flash movie but the white blank sides did not disappear ?
I want that the flash movie has all the space of the dispaly window so that no white space appears when I view it in normal or maximized or full-screen view modes ?
I'm attempting to load into an array data from an external .csv file. No problem here.
I load into a first array all of the data and split the data at the end of each line ("
").
Then, I place into a new array each line that was split.
The problem is that the last element in this new line comes with an invisible space such that when I do a trace they come out as follows:
AAAA
BBBB
CCCC
instead of
AAAA
BBBB
CCCC
This is a problem because I later on do a switch check for 'AAAA', 'BBBB' or 'CCCC' and I think it doesn't recognize any because of the space.
I am trying to parse a string in order to remove all extra white spaces.Iâm working in AS3 and at the moment the only pattern I found remove all content:
field.text = field.text.replace ("As+|s+z", " ");[code].....
I'm making some kind of rssreader right now... everything goes really well but the only thing is that when i read data from xml i get some empty lines in my text. like this:BAJKONOER - De Europese ruimtevaartorganisatie ESA heeftwoensdagochtend de Europese ruimtesonde Venus Express gelanceerdit just stops after "heeft"... it seems like a normal return... but how do i get it out of my string?
View 3 Repliesis there any function to remove blank space in a text string?
something like have a="Hello " and can get a="Hello"
I have a web design for a client that was pretty much complete. They decided that they wanted to replace one of the graphics with a flash animation. When I added the swf file to the layout in Dreamweaver it apparently is adding some space around the swf which breaks the rest of the design. It looks to be about 4 pixels or so of space that is getting added. I experimented with padding, margins, borders on every element in the design. I tried changing the Scale parameter of the swf to "no border" and "exact fit". I tried enclosing the elements in a table. To simplify things I created a new blank page in Dreamweaver and added the two elements that are giving me grief. The original width of the design was 792.
On the top I had 2 graphics, the first was 212 wide and the second was 580 wide. The first graphic is the one that got replaced with the swf file. The swf is also 212 wide. But for some reason there is that extra space on the right side of the swf that forces the second graphic to the next line. You can see the example here: [URL]. This shows what happens when the original graphic was replaced with the swf. (The swf doesn't do anything as I actually replaced the client's swf with one I made that has the original graphic as the only item in the movie). If you look here: [URL]. I changed the width of the second graphic to 574 wide. That kept the graphic on the same line, but you can clearly see that the swf has the unwanted space to the right.
URL...The problem is with the flash banner at the top. It was created with a utility for creating banners and displays in firefox without any problems. In IE 8 there is white space to the right and I cannot get rid of it anyhow.
View 5 RepliesI can't figure out how to get rid of extra white space in the browser at the top of a swf file. It looks fine when I preview the file, but when I do publish preview in flash/ try to incorporate in HTML, there's an extra 1/4" at top of window.
View 3 RepliesWe are using Mike Davidson's SIFR implementation and so far so great, however we have noticed that it converts any white space into %20's, unfortunately that breaks any % signs we have in our product descriptions.
View 1 RepliesAfter turning my files to fla and creating swf I happy embedded them into an area in my Dreamweaver page. A grey space area appeared with a Flash icon. A command window open placing two files in a script folder and then I went to the browser (safari in this case) and there was my webpage with a white space where the Flash video should have been.
View 4 RepliesI'm unable to remove the white space between SWF's on a HTML page.
I know about using 'block' in the CSS, but as it's horizontal that doesn't seem to work. I've also added "0" for border to no avail.
My HTML code:
<div id="banner">
<div class="wrap">
<div style=height:66px; align="center">
[Code].....
how to trim starting and ending spaces and also how to replace two or three spaces into one space in as2
View 9 RepliesI am trying to load an external text file containing some HTML. I am very new to AS3, and am wondering how I would go about ignoring all the white space in the file. Here's the code I'm using:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
[code]....
I don't know why, but for some reason I'm not getting the contents of an array with the whitespace included on them.
Eg. "NewYork" instead of "New York"...
ActionScript Code:
var Cities:Array=[
"New York",
"New Delhi",
[Code].....
I have a WP 3.0.2 site. When I try to embed a swf file I have uploaded, all I get to show up, in either a post or a page, is a white area the size of the height & width paramaters. In order to play the flash video, I need to right click and select "play" from the menu so watch the movie.
I am trying to figure out what I am doing wrong or why there are not play, pause stop, controls showing up and why the video preview image does not show up either
I am pulling my hair out over this one.surprised
NOTE; The WP SWFObject Plug-ins do not help with this. I have tried many of them to no avail.
[Code]......
I have a flash movie, height = 151px width = 228, this is placed within a table cell (
cellpadding = 0 cellspacing = 0 vertical-align = top), but when it displays within the explorer windows thereis a white space about 20px above the flash movie. I want the flash movie to appear directly under the grey lines.[code]...
What I'm trying to do is using a loader to load some videos. If the video is not found, I just want to display a white space in the loader. [code]...
View 3 RepliesI am trying to load a html text from a XML with flash cs4 but It loads with huge whitespace before and after the text. In an older, different version of the site made in AS2 it loads the same xml with no whitespace.I've tried setting xml.ignoreWhiteSpace = true but it doesn't seem to change anything.
flash code:
Code: Select allvar XMLRequest:URLRequest;
var XMLLoader:URLLoader;
var xml:XML;
[code]....
Is it possible to use an load an external text file with multiple variables and line breaks? In other words could I make:
Code:
&defaultParkNum=1&printEnabled=no&usePointer=yes
look like this?
[code].....
My XML has white space between every line so i used txt.condenseWhite=true; which worked well except now the paragraphs have no white space how can i get rid of the white space between lines and conserve the paragraph white space?
View 2 RepliesI am working on a Flash project where file size optimization is critical. I am curious if removing white space from the code (which lowers the size of the AS file) will reduce the size of the finished SWF or if the Flash compiler already does this?
View 2 RepliesIs it possible to ignore white space between characters inside a text input field let's say a user types in "bri an" instead of "brian. Is there a way that white space is ignore and treated it as one word?
View 1 RepliesAn example of it is viewable here:
[URL]
The .swfs that make up this website were originally made by somebody else who has asked me to help them get the site working online the way they intended. The main problem I'm having now is making this white space (that appears briefly in shape of .swf's dimensions) go away. The flash projects for the swfs do not even have a white background, neither do the HTML documents. Deadline for solving this problem is early tomorrow and I am stumped. This even happens with tiny, 40kb swfs with preloaders (I thought reducing swf sizes, adding preloaders might solve problem somehow)
My project is almost complete except for this last little thing that's been bugging me. A tutorial I followed had you start the game by clicking a button but I would like to change that to pressing the spacebar starts the game. I tried:
if(Key.isDown)(Key.SPACE))
{
_root.ship.newGame();
}
[Code].....