ActionScript 2.0 :: Convert Spaces To Underscores?
Nov 25, 2003Is there a way to convert spaces to underscores?
turn "This is a string" to "This_is_a_string"
Is there a way to convert spaces to underscores?
turn "This is a string" to "This_is_a_string"
Is there a way to convert spaces to underscores?
turn "This is a string" to "This_is_a_string"
i'm trying to do a string replace with but can't seem to get the regular expression right. change "/portfolio/2/3/" to "portfolio_2_3"? Basically I want to remove the leading and following slashes, and convert all the other slashes to underscores.
View 2 RepliesHow do I parse an XML document that contains nodes where underscores exist?
<some_xml>
<child_node>
<child width_info="" height_info="" />
[code]....
I'm using deeplinking in a Flex 3 application. I've got a ViewStack and I'd like to use the id's of the canvases in the url. I've read that search engines prefer hyphens over underscores as word separators. So, the search engine sees "big-book" as a separate word, but "big_book" as possibly one word. Also, underscores are obscured when a link is underlined. For the above reasons, I thought that it would be good to use hyphens. The problem is that Flex doesn't allow hyphens in an id.
<ViewStack>
<Canvas id="my_stuff"></Canvas>
<Canvas id="my_stuff_more"></Canvas>
<Canvas id="my_stuff_lots"></Canvas>
</ViewStack>
I want to make a text box that will not allow spaces to be entered. Is there some actionscript to do this?
In other words, a user typing 'John Smith' would just display 'JohnSmith'.
So I have a string "SmartUserWantsToLive" I want to generate from it or any such string with capital letters strings like "Smart User Wants To Live".
View 1 RepliesIn the 4 * 5 array that makes up a colour matrix, what do ALL the values do? All I have found is basically this:
0, 0, 0, 0, 0 <-R
0, 0, 0, 0, 0 <-G
0, 0, 0, 0, 0 <-B
0, 0, 0, 0, 0 <-A
What does each thing do?
when i open up my swf file , there's always white spaces at the top of the window. but when i open up my .fla file, everything is in place. How can i remove that white spaces?
View 1 RepliesIs there a simple inbuilt function in AS3 to remove spaces in a String??
View 3 RepliesI want to remove spaces from the end of a string.
apple = "A P P L E ";
to
apple = "A P P L E";
I'm slowly converting my older Director-made tutorials to Flash. The user inputs text, and then I evaluate it. Before this evaluation, I want to remove spaces to avoid the user's input being counted incorrect because of an extra space. How do I do this for Flash CS5?
Here's what I did for Director.
[Code].....
im new with regexp, so can i ask for some assistance
Using string.replace function what code that can replace spaces with comma
Input:The quick brown fox jumps over the lazy dog.
Output:The,quick,brown,fox,jumps,over,the,lazy dog.
I am using CKEditor in my website's CMS, which spits out an XML file of CDATA enclosed content to be read by flash. The problem is that CKEditor, when its enterMode is set to <p> tags, creates a line break and a tab in the source which, when read by flash, enters space, even though I have ignoreWhiteSpace set to true. Any way to prevent ckeditor from using this behavior?
EDIT:
I still want to keep any <p> tags entered from within the editor - I just don't want all the extra space / tabs that get added in the actual source. If I use the above method, my actual code will be modified. What I'm getting if I view the source is this:
<p>
Donec at erat nec tortor sodales tempus.</p>
(an enter, and either a tab or a bunch of space after first <p> tag, instead of:
<p>Donec at erat nec tortor sodales tempus.</p>
(no spaces or breaks after <p> tag in source and I believe this is affecting the presentation of the XML.
I'm using the weather.com web service to request current conditions for a location, and am parsing the current temperature, feels like temp and current condition icon to my Flash application. The Current Temperature and Feels Like Temperature nodes are nested within NowItems -> NowItem while WeatherToday is further along in the feed. I've written the following in AS3[code]...
View 1 RepliesIs it possible to configure Flash Builder 4 to indent using spaces instead of tabs?
I've enabled Preferences > General > Editors > Text Editors > Insert spaces for tabs but it still inserts tabs. I've tried editing files with no tabs but it still inserts tabs.
What's strange is that Insert spaces for tabs works in Eclipse but not Flash Builder, which is built on Eclipse. Perhaps there's a bug in Adobe's portion of Flash Builder.
I'm running Flash Builder 4.0.0.272416 on Mac OS X 10.6.
For example, if I have two classes called _Sub_class and MainClass
[Code]....
Does test3 take up the same space as when it's initialized? (i.e. when a function inside MainClass call the initialize function for the test3 variable?)
I need to make a little program in AS3 that count spaces in a stringexample: The capital of England is Londonnumber of spaces: 5
View 9 RepliesSo basically i have a bunch of movie clips which have instance names that i am pushing to an array and then that array is printed to a dynamic text field that displays the list of the movie clips. The issue is, i want this list to look presentable and since instance names cant take spaces only underscores then it looks so un-presentable
ActionScript Code:
import flash.text.TextField;
//Array to hold the target instances, the drop instances,
[code].......
I made the following function to fade in and out four clips:
Code:
function fadeSq (clips, fade, speed){
while (clips.length){
clips[0].onEnterFrame = function(){
var fadeOut = fade - this._alpha;
[code]....
and I'm calling the code this way:
Code:
this.fadeSq ([btn_about_us, btn_Products, btn_product_codes, btn_contact_us], 0, 3);
As you al can see am I using underscores in the call back function, which I don't want because I want to display the information in a dynamic textfield. But when I leave open spaces I get all kind of errors. How can I prevend this?
What I am trying to do is take a string of numbers and convert it into an array, while cutting out the non-digits. Here is the format:1.0000000e+000 1.3668423e+000 1.0000000e+000 1.3668423e+0001.0000000e+000 1.3668423e+000So it's basically: Space, Space, Digit, Space, Space, Digit, NewlineRight now I am using the following code (myString is a String, and dataSet1 is an Array):
var reg:RegExp = new RegExp("
");
myString = textLoader.data;dataSet1 = myString.split(reg);
[code].....
So I'd like to remove all spaces from an input text box, and replace them with commas, and I'd like to learn how to do this with RegExp, which I've never before used.This doesn't work (though if I do s.search(re) it returns the first space):
Code:
var s:String = searchTerms.text;
var re:RegExp = /s/g;
[code]....
I made the following function to fade in and out four clips:
Code:
function fadeSq (clips, fade, speed){
while (clips.length){
[code]....
I use XML which has HTML text embedded in it. When i m displaying this text in Flash it gets displayed with spaces I m using AS 3.0,I have also used
<Xml_Variable>.ignorewhitespaces= true
but still not working
The Library allows Movie Clips to be named with spaces on the end.This causes problems when exporting library items with linkages.When exporting you don't get an error, but the item does not show up in the build.Is there a reason you allow spaces on the back of Movie Clip names?
View 1 RepliesI 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.
How can I have Flash reading XML ignore white spaces that would be ignored in HTML?
[Code]...
I don't want the spaces or the new lines that show in the text to show in Flash. In HTML there is no new line character between the two lines either.
For a multiple choice questions, I would like to format text like this :
[Code]...
I tried with 3 labels in horizontal layout for each lines but it doesn't work for the third case.Now I use tabStops for alignment, it work well, but I can't find how to replace spaces by dots in a proper way.
I'm building a word search game using the following AS3 code. My problem is I need to have spaces in my array of words, so that I can have things like states names, but I need the spaces removed before the words go into the puzzle.
The other concern is also that when a person selects a word from the puzzle will it still match the word in the list even though the word in the list still has a space.[code]...
I am working with a function that converts csv data to a multi-dimentional array. I am then going through the characters to find specific situations in the way the strings are handled in the array. One example is if I have a string like - "this is a string, yeah" - then I make sure not to count the comma in the string because it is between quotes from that string. Anyhow In the following function I have some how lost my spaces in the results.Instead of getting "this is AS3" I am getting "thisisAS3". Spaces seem to only be available in the strings that have quotes.
function CSVtoArray(csv:String):Array {
var inQuotes:Boolean = false;
var field:String = "";
[code].....