String Manipulation?
I have a string that outputs in a dynamic textfield
I am trying to get each item on a new line...
I got advice from someone last night that did not work...
that was use /n or <br> with html formattting on....
So here is the actual line of code
body = "APPLICANT:"+name+"DAYPHONE:"+dayphone+"EVEPHONE:" +evephone+"E-mail:"+email+"MAILING ADDRESS:"+mailaddress;
I would like it to read
APPLICANT:name
DAYPHONE:313-896-8956
etc...........
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-08-2002, 11:20 AM
View Complete Forum Thread with Replies
Sponsored Links:
String Manipulation : Pad A String.length
hi,
i have an array of track/artist titles
_level0.trkList = [object #218, class 'Array'] [
0:[object #219, class 'Object'] {
label:"Jeff Beck - Space for the Papa",
data:"spacepapa.mp3",
__ID__:0
},
1:[object #220, class 'Object'] {
label:"Jeff Beck - Another Place",
data:"anotherplace.mp3",
__ID__:1
},
i wish to add the array to a track info listbox component,
in such a way that the individual items in the array are
padded with spaces -" ", so as the length of the shortest
string equals the length of the longest string,
my listbox output is now -
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place| * from time array
by adding spaces i would like it to be-
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place"""""""| * from time array
does anyone know how to do this ?
many thanks for any help,
View Replies !
View Related
String Manipulation
Im thinking about creating an application which loads text from an external file and displays it on screen.
What I need to do is some way of making sure that the text string has the apropriate format where words are not split in half when a new line is added.
Does anyone know of any good examples like this?
View Replies !
View Related
String Manipulation
I have looked on this board for some help, but I still cant get this to work for me.
I would just like to do three things to a string.
I am making a form that returns calculations depending on user input. It deals with money.
I need to have all variables to contain the .xx (cents)
so 1 should be 1.00 and 12.5 should be 12.50.
also I need to only show two places after the decimal point.
One other thing, is I need to write up a check to see if the variable already contains a . or not, and if it doesn't to add the .xx or .x0.
I hope Im making sense. I have tried doing the .indexOf('.'), but it doesnt seem to work, It doesnt return anything.
View Replies !
View Related
String Manipulation
I have a movie which POSTs variables out to......ah dont matter - the backend of the site.
during the movie i use a variable called "childAge_1". How do i change that var name to "CHILDBIRTH_DATE-1". Ive started using this.....
name=_parent._name; //gets "childAge_1"
outputName=name.split("Age_1");
so now i get "child," errr dont know what way to tackle this....scared....help!
Cheers
View Replies !
View Related
String Manipulation
I've looked a bit over the ActionScript associated with strings, and there doesn't seem to be very easy ways to manipulate them. For instance, let's say I have the sentence "My name is Bob.", and I want to remove the word "name" and return "My is Bob.".
I'm not even sure how I would do this in ActionScript. Anyone want to fill me in?
View Replies !
View Related
String Manipulation Q?
On the main timeline, I have these variables set...........
Code:
path = "";
songs = " TRACK1,TRACK2,TRACK3,TRACK4,TRACK5,TRACK6,TRACK7,T
RACK8,TRACK9,TRACK10";
artists = "Dr John,John Lee Hooker,Eric Clapton,Stevie Ray Vaughn,Stevie Ray Vaughn,Average White Band,ZZ Top,Queen,Aerosmith,Allman Brothers";
titles = "Wrong Place,Boom Boom,Tore Down,Taxman,GuitarHurricane,Funky Music,Low Rider,Fat Bottom Girls,Pink,Midnight Rider";
sizes = "1,2,3,4,5,6,7,8,9,10";
total = 10;
Inside a MC I have a textbox named "songlist". The actions on the MC containing the "songlist" are..........
Code:
onClipEvent (load) {
artists = ..:artists.split(",");
titles = ..:titles.split(",");
for (i=0; i<artists.length; (i++)) {
songlist = artists[i] + " - " + titles[i] + "
";
}
}
This only displays the last artist and last song in the variable list. I would like to have the list populate with all the songs and artists. Any suggestions/help???
Thx
Regards
~GD~
View Replies !
View Related
Help With String Manipulation
Hey.. First off, a confession.. For some reason, string manipulation sometimes confuses me.. So i need a little help getting started with an experiment..
I'd like to have an input text box. The user would type in a model number (for intranet at work), or a partial model number. Depending on what the user types in, a list box is populated with exact and/or possible matches.. I know how to work with exact data, but can someone show me how to check against certain characters and find possible matches?
The possible models numbers can be hardcoded or dynamic, doesnt matter.. Just want to try to understand the principle behind doing this, so i can modify it and try to get it to work like i want it to...
thanks in advance to anyone who helps..
-myk
View Replies !
View Related
Help With String Manipulation
I'm pulling a value from an xml document ie..Agricultural Equipment, and applying it to a variable called "name". I want to take the value of "name" and create an swf file. the problem is that the names vary in length and they contain a space. The length is an issue, I want to get rid of the space and use the variable "name" as the newly created swf file.
Anyone have a good suggestion for doing this?
Thank you,
View Replies !
View Related
String Manipulation
Hello,
I need some help here doing a string manipulation,
I have on php output like this
month1=January&. fair1 / 18 to 22 . fair2 25 to 29
&month2=April&. fair11 to 4 . fair2 28 to 4
&&n=5
I need to make flash read how many fairs there are inside each month, so I can create my buttons.
Any ideia?
I'm triing this flash code,
var lv:LoadVars = new LoadVars();
lv.load("php/listar_news.php");
lv.onLoad = function(sucesso) {
if (sucesso) {
for (knews=1; knews<this.n; knews++) {
var noticias:String = this["mes"+knews];
for (kn=0; kn<noticias.length; kn++) {
noticia = noticias[kn].split("
");
getURL("javascript:alert('"+noticias[0]+"')");
}
}
}
};
Thanks a lot,
Pluda
View Replies !
View Related
String Manipulation?
I have a simple string that I'm passing using jsfl and I need to keep the double quotes and can't seem to figure out how to do it.
jsfl = "_root.gotoAndPlay('up');";
That works for single quotes but doesn't for double quotes?...
Thanks
View Replies !
View Related
String Manipulation
How's it going?
I need to do some string manipulation. I need to take a string in the form "artist - song" and extract both the artist and the song and store them in seperate variables.
Any pointers in the right direction?
Thanks,
Saveth
Here is my unsuccessful attempt
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
songTitle = xmlNode.childNodes[8].childNodes[0];
// TRYING TO ATTEMPT SPLIT
buyButton = xmlNode.childNodes[8].childNodes[0];
storedStringArray = buyButton.split("-");
songName = storedStringArray[storedStringArray.length-1];
songTitle = songTitle_txt.text.toUpperCase();
songTitle = songTitle_txt.text.searchReplace(" - ", ": ");
songTitle_txt.autoSize = true;
buy_mc._x = songTitle_txt._x+songTitle_txt._width+5;
buy_mc._y = songTitle_txt._y;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://www.crylounge.com/shoutcast.php");
function loadNewXML() {
xmlData.load("http://www.crylounge.com/shoutcast.php");
}
setInterval(loadNewXML, 10000);
String.prototype.searchReplace = function(str, rep, chr) {
var t = (chr<0) ? this.substr(chr) : this.substr(0, chr);
var s = str.length;
var r = rep.length;
var p = t.indexOf(str);
while (p != -1) {
t = t.substr(0, p)+rep+t.substr(p+s);
p = t.indexOf(str, p+r);
}
return (chr) ? (chr<0) ? this.substr(0, this.length+chr)+t : t+this.substr(chr) : t;
};
buy_mc.buy_btn.onRelease = function() {
getURL("http://www.google.com", "_blank");
}
View Replies !
View Related
=== String Manipulation Problem Please Help ===
Hi all,
I want to make a function that transform some texte into numbers.
a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7
h = 8
i = 9
j = 0
k = 1
....
I have made a small function but it doesn't work and I don't know why !
Here is my funstion :
function mf (texte) {
alpha = "abcdefghijklmnopqrstuvwxyz";
for (j=1; j<=length(alpha); j += 1) {
if (j<10) {
eval(substring(alpha, j, 1)) = substring(j, 1, 1);
} else {
eval(substring(alpha, j, 1)) = substring(j, 2, 1);
}
}
for (i=1; i<=length(texte); i += 1) {
lettre = substring(texte, i, 1);
lettre = lettre.toLowerCase();
}
trace (eval(lettre));
}
Please Help !
View Replies !
View Related
Urgent Help With String Manipulation
please help! i need to make an encryption program(really simple). i have a text box with the input and one for output and a button. Here is the script:
on(keyPress "<enter>"){
function letter(letter){
LETTER=new String(letter)
I=new String(i)
for(i=0; i<alpha.length; i++){
if(LETTER==alpha[i]){
this.number=I
}
}
}
encodeInString=new String(encodeIn)
encodeArray=encodeInString.split("");
for(i=0; i<encodeArray.length; i++){
letterArray[i]=new letter(encodeArray[i])
}
encodeOut=letterArray[0].number;
}
obviously, this doesnt work
can anyone please show me how to take a sentence, and convert each of the letters into numbers depending on what the letter is(ie: a=0, b=1)
then i need to do an operation on them, and turn them back into letters. can anyone help!?
View Replies !
View Related
Gurus, Help With String Manipulation
thanks a lot of someone can help with this one.
my string takes the form of path to a .swf that looks like this: "video/test.swf" where test may be any name for the .swf and any length. for example it might be video/bigmovie.swf or video/thebadmovie.swf etc.
i need to extract everything inbetween the"/" and the"." so i can use that to reference a frame label that has special info for that .swf
any ideas?
thanks.
--grish
View Replies !
View Related
Variables And String Manipulation
I've been pulling my hair out at this very simple problem.
I want to load a variable from an external text file and use that variable in a sound class, here's my code:
Text data file:
Quote:
&toPlay=http://domain.com/Some Song.mp3&
Actionscript:
Quote:
//load variables from external text file
_root.loadVariables("http://domain.com/temp.txt");
//stick the variable from that text file into the sound class
//what am I doing wrong? it makes complete sense in my head
soundContainer = new Sound(this);
soundContainer.loadSound(toPlay, true);
View Replies !
View Related
Simple String Manipulation.
I have been using the textscript class for a few groovy text effects but I have a problem where punctuation is concerned. Given that the class breaks a string up into individual text fields for each character in a string, all special characters are displayed as their html notation.
What I would like to do is alter the string so that the characters work correctly. eg. & #032; becomes '
View Replies !
View Related
String Manipulation In Function
I'm using a function to call multiple button actions, so I don't have to rewrite code for each button... here's the script:
Code:
function btnSelect(num){
var btnA = "btn" + num;
btnA.onRelease = function(){
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[num], 1);
desc_txt.text = description[num];
picture_num();
}
}
}
btnSelect("0");
btnSelect("1");
btnSelect("2");
btnSelect("3");
btnSelect("4");
This is all part of a clip which loads pictures externally... each of the buttons (which are mc's) are named btn0, btn1, etc.... any ideas how to make this work??
View Replies !
View Related
String Manipulation Problems
Argh. Confusing problem:
actionscript Code:
Original
- actionscript Code
// format the address
if ( _root.cache["cache_" + id + "_address"].indexOf('<br/>') < 1 and _root.cache["cache_" + id + "_address"].indexOf('<br />') < 1)
{
var address_array:Array = _root.cache["cache_" + id + "_address"].split(",");
}
for (var i = 0; i< address_array.length; i++)
{
address_string += (address_array[i] + ",<br>");
trace(address_string);
}
var final_address_string:String = address_string.substr(0, (address_string.length-5));
_root.infoDisplay.flag_address.htmlText = final_addess_string;
// format the address if ( _root.cache["cache_" + id + "_address"].indexOf('<br/>') < 1 and _root.cache["cache_" + id + "_address"].indexOf('<br />') < 1) { var address_array:Array = _root.cache["cache_" + id + "_address"].split(","); } for (var i = 0; i< address_array.length; i++) { address_string += (address_array[i] + ",<br>"); trace(address_string); } var final_address_string:String = address_string.substr(0, (address_string.length-5)); _root.infoDisplay.flag_address.htmlText = final_addess_string;
The original address:
Code:
67 St. James's St, London, SW1A 1PH
The trace():
Code:
undefined67 St. James's St,<br>
undefined67 St. James's St,<br> London,<br>
undefined67 St. James's St,<br> London,<br> SW1A 1PH,<br>
Displayed in the TextField:
Code:
undefined
Eh?
View Replies !
View Related
String Manipulation Removing Words Between Delimiters
I am trying to remove words that occur between delimiters in a string.(this can also be an array if it helps any..)
These words have to be saved to different variables:
ie:
"This is the /string/that/has/to have the words 'string' 'that' and 'has' copied out"
var1 = "string"
var2 = "that"
and
var3 ="has"
I am not sure if this is possible but any ideas are welcome.
any body help?
Thx
Shaf
View Replies !
View Related
String Manipulation With "this" Object
I have a button within a movie clip that passes an identifier to a function like so:
on (release)
{
_root.getname(this);
}
The function recieves "this" as "_level0.mc_main_menu.game0"
I want to treat the returned value as a string & get the value "game0" from it.
How do I do this?
Am I right in saying that "this" is an object, and I need to convert it to a string first?
p.s - in case your interested - the value "game0" matches an xml node & the function plays a movie clip which is populated by the node attributes.
View Replies !
View Related
How Is This Txt Manipulation Done?
Hello,
I need some help please!
I am working on a project where the user picks a font, types a message and can manipulate the text once added. I have searched all over for clues on how this is done with no luck.
I am attaching a .jpg of a site that has something similar that I need to do for reference, and here is the link http:// www.designAShirt.com.
Any help pointing me in the right direction would be greatly appreciated.
xcaliber
View Replies !
View Related
XML Manipulation
Hi,
Can anyone tell me how I would go about using E4X XML processing to return the elements labelled "//this" below. I have tried using things like conditions.descendants() which will return the greater and lessThan elements, but that ignores the equalityCondition elements.
Is there some easy solution I am over looking?
Code:
<conditions>
<equalityCondition questionID="id5" response="1" /> // this
<andGroup> // not this
<greaterThanCondition quesitonID="id6" response="-1" /> // this
<lessThanCondition quesitonID="id3" response="2" /> // this
</andGroup> // not this
</conditions>
Thanks in advance
View Replies !
View Related
XML Manipulation
Hi, I'm a beginner in this stuf and I want to do in flash a simple prices table (a list) that I "import" from Excel and I transformed in XML throught FileMaker.
I'm lost in many information and I want a good source of information in order to understand that (if possible in portuguese or spanish).
Thanks in advance
View Replies !
View Related
OT: XML Manipulation
This is a bit off topic, but not entirely un-Flash related. I'm doing some on-line training that has some questions at the end. I'm converting a course made by somebody else into our system. The existing questions are in an XML format and have various attributes and such that we don't use. Additionally for example their code marks the correct answer with a "1" and we use "true" etc.
I'm hoping to find some kind of tool for manipulating XML in an easy way. Anybody have any tips?
View Replies !
View Related
Variable Manipulation
hey
i'm trying to make a guest book, but when i try sending data that has html tags to my php3 script, it gets cut off so what i want to do is replace some of the html tags.
if i type in:
"This is a test message
From PaladinL"
into a text box that has html checked off
the real data looks like this:
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">This is a test message</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">from PaladinL</FONT></P>
now what i want to know how to do is
transform
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">This is a test message</FONT></P>
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">from PaladinL</FONT></P>
into
this:
This is a test message
lFrom PaladinL
basically i want to remove all the:
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">
and replace all the:
</FONT></P>
with:
l
how can i do this?
i really need to know how to do this for my guest book
thanks to anyone who helps
View Replies !
View Related
Photo Manipulation?
Is there any way to work with photos after they've been brought into Flash? I'm wondering if some of the drawing functions can be used to manipulate them. Also, can I get photos to change scale like text?
View Replies !
View Related
Variable Manipulation
This is just a general question in general (Ok, who else likes redundancy?). Um, I've got a text variable in a movie clip within a flash movie. All script within the clip has no problem with manipulating the variable. But when I try to have some script outside of the movie clip interact with the variable, nothing works. I figured it might be addressed something like "movieclip.textvariable=" but that didn't work. Can anybody clue me in? Thanks
View Replies !
View Related
Graphic Manipulation
I have a 2d graphic animation of a fish, at the moment he follows a path weaving from one end to the other but I want him to swim into (facing) the background then turn the other way (so that he swims deeper into the "sea" and turns around...
I can figure it out and its driving me mad!!!
Any help/ideas will be greatly appreciated.
Cheers
View Replies !
View Related
Text Manipulation
I downloaded some text effects off this site, the same ones used in "flash typer". I down loaded it instead of using the typer because there were a few things about it I wanted to change. The only problem is I can't get it to display more than one line of text. I need five single words on five separate lines, the code was written in flash 5 and I'm using MX ....can I get some help please.
View Replies !
View Related
Text Manipulation
I downloaded a text effect alot like the ones in the "flash typer". The problem is an entire sentence will be displayed on one line. Can someone tell me how to make it display the text on multiple lines.
View Replies !
View Related
Text Manipulation
I downloaded a text effect alot like the ones in the "flash typer". The problem is an entire sentence will be displayed on one line. Can someone tell me how to make it display the text on multiple lines.
View Replies !
View Related
Text Manipulation
I downloaded a text effect alot like the ones in the "flash typer". The problem is an entire sentence will be displayed on one line. Can someone tell me how to make it display the text on multiple lines.
View Replies !
View Related
Image Manipulation
What I want to do is have a flash movie on the web, then be able to import a jpg from my HD into the flash movie, then manipulate the jpg (scale, rotate, etc) within the flash movie...
Any thoughts?
View Replies !
View Related
Frame Manipulation
Sorry if I'm taking a shortcut here, but the help files suck in Flash MX 2004. I also failed to turn up an answer by searching this forum.
Total noob to Flash. First thing I try is to import an avi of a seagull flying. Really impressed with the movie import wizard. Now I have 30 frames that I want to play with. Only problem is that I can't delete the first frame. I tried deleting it with and without clearing it as a keyframe. I then tried adding a keyframe right after it, but that just inserts another copy of the movie. So, screw it, I start from scratch and re-import the movie, selecting a different starting image. Okay, but now when I try to delete some superfulous frames in the middle of the sequence, the program just keeps removing a frame from the end of the sequence instead of the one that I have high-lighted. Wtf??? Am I stupid, crazy, or is the entire program this non-intuitive?
View Replies !
View Related
Color Manipulation
Is there any easy way to manipulate colors of a clip using ActionScript ?
Suppose I have a clip called "TheClip", how can I change it's RGB color value using ActionScript ?
Any working example (tutorial) ?
Thanks a lot
View Replies !
View Related
Multiple MC Manipulation
Okay (i hope you understand all this!) i have a normal animation on the stage that plays up with moving parts and screens popping up etc, within that i have a MC 'TV screen' which switches on, animates for a bit then loops on a flicker animation. BUT as this is in a MC and not on the stage this is where it gets a bit wierd. I want the animation to hold on until the 'TV screen' has played onto the flicker loop before the main movie continues on its way. from there i want to make a bunch of MC's that will go onto this 'TV Screen', because in between them there will be pauses where more little bits of animation will happen on the main stage. Anyone care to enlighten me? I dont regard myself as a flash newbie but im hopeless at actionscript (then does that make me a newbie? i don't know!)
Thanks
View Replies !
View Related
Image Manipulation
Does anyone know of a Flash tool or utility for image manipulation or editing?
I would like the users of my site to be able to edit their uploaded images, eg crop, resize, rotate, add text, brightness etc...
Many Thanks
View Replies !
View Related
Array Manipulation
I am making an educational game - users construct a vehicle out of various components: chassis, pulley and body. Users also choose a type of track, hilly or flat. I have 4 Arrays: myChassis, myPulley, myBody and myTrack made up of 10 movie clips.
From my 4 Arrays I would like users to be able to construct a new Array containing a single element from each of the exisisting 4 Arrays. Can someone please advise me how I go about achieving this? I have attached my .fla, am using MX 2004 pro
Any help is very much appreciated
Thanks
View Replies !
View Related
Audio Manipulation
I have around 90 sounds in my flash animation that I wish to alter at the touch of a button.
These sounds are basically short sentences......at the touch of a button, I want all of these sounds to sound as if they are being spoken over a radio.
Is there a flash audio plugin that will enable me to achieve this ?
Or can I do what I need in actionscript ?
I've checked around with no luck so far.
Cheers
Koit
View Replies !
View Related
Time Manipulation
Hi,
I am trying to implement a timeout function for my application. I have a time string that I import in the format "00:05:00" (C# - representing a 5 minute timeout).
I am trying to run a timer that runs every second or so and calculates when the timeout has been reached.
I could just compare the minutes but it could be "01:05:20" for example. Is there an easy way to achieve this?
There doesn't seem to be many time manipulation functions available
Any help would be appreciated
Thanks
View Replies !
View Related
Array Manipulation
Hi All
I am making an educational game - users construct a vehicle out of various components: chassis, pulley and body. Users also chose the type of track, hilly or flat, on which they will race their vehicle. The race element of the game is purely a simulation, users will have no control over their vehicle during the simulation stage of the game.
The skill will be in the user choosing the correct components to ensure their vehicle wins the simulated race. As it stands the various options are stored in 4 separate arrays, chassis, pulleys, bodies and track
Creating an empty array I can do - but how do I store and display the various options the user chooses when constructing their vehicle and finally manipulate the array so that the correct simulation movie can be loaded. I anticipate I will have a 18 movies each, the total number of combinations, for both the hilly and flat tracks.
I have attached an .fla of what I have got done so far.
I am using Flash MX 2004 Professional
Any help is appreciated.
Cheers
View Replies !
View Related
Image Manipulation
I'm trying to implement an application that allows image to rotate, resize and remove.
So far, my prototype version does it almost all, however there are some bugs on it. For example, after a rotate an image if a try to scale it it goes crazy,ie. the image jumps out of the box.
I'll attach my file.
Please help
thx
View Replies !
View Related
Text Manipulation
Not sure if there is a tutorial out there that i am missing, but what i am trying to do is to have seperate buttons that control text color, text weight, and text font. all of these buttons are inside of a movie clip that will control the default text properties any ideas?
View Replies !
View Related
Array Manipulation
Hi,
I have a quick question
Lets say i have
Array1
Aray2
Array2 is empty, array 1 has 5 indexes.
Lets say i wanted to place the value of Array1[3] into the first element of array2, and re-number array1 accordingly
Is this possible?
View Replies !
View Related
Bitmap Manipulation
Hi,
I need to fit a bitmap inside some quadrangular (simply, four points...).
I tried beginBitmapFill, but that is not what I need. I need to distort the image to fit (my quadrangular is a 3D surface that I what to put texture on).
Thanks alot.
View Replies !
View Related
|