Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How Do I Get An Apostrophe (') In A String?



How can I get an apostrophe (') in a string. It is ignored when I use this.


PHP Code:


"'" 



I am trying to concatenate an apostrophe to some dynamic text.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-25-2006, 06:43 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Apostrophe In Dynamic Txt
how do i make an apostrophe when loading a txt file into a dynamic txt field?

GetURL With An Apostrophe
Hi there

What I am trying to do is create a pop-up window which will link to a persons existing id code. The id code is the persons name in the format: last, first
The problem occurs when the person has an apostrophe in their name. The URL keeps breaking when it comes to the apostrophe. I tried using the ascii equivalent in the getURL statement, but flash still seems to convert the %27 back to an apostrophe before opening the window, so I get a javascript error and the window won't open.

Is there a way to make flash disregard the apostrophe and include it as part of the url??

The code would look something like

on (release) {
getURL("www.address.com/records.asp?cc=O'Grady, Tom", "_blank");
}

I have tried using cc=O%27Grady%2c+Tom and it doesn't work either.
I also tried creating a variable and using .asp?cc=" + idcode + "

Hopefully that makes sense to someone. Any help would be appreciated. Cheers
G

Apostrophe Asp Blues..
Hi,

i've made this wicked liyyle diary booking message system but i've found a problem with it (the very last one). The flash movie calls for and sends data through some asp vbscript but messes up when sending text that contains apostrophes ie don't couldn't wouldn't. The asp page searches for apostrophes and changes them to double apostrophes so it will go into the access database correctly. Thats been tested and done. But when the asp page is amended to take data from flash it stops working.

Is there something i've missed? Its definitely the actionscript that is causing the error:

submit_tip = new LoadVars();
submit_tip.tiptitlemem = _root.selectedNameDiet;
submit_tip.tiptitle = _parent.tiptitle.text;
submit_tip.tiptext = _parent.tiptext.text;
submit_tip.sendAndLoad("change_diettips.asp", submit_tip, "POST");

thats the actionscript. heres the asp checker code:

tiptitle=request.form("tiptitle")
tiptitle=replace(tiptitle,"'","''")
tiptext=request.form("tiptext")
tiptext=replace(tiptext,"'","''")

any help would be great!

steven.

Apostrophe (') Problem In XML
Hi, friends,

I just got another new problem.

I'm loading XML file into flash, and the apostrophe displayed as a vertical pipe in the movie.

like "it's a beautiful day" will displayed like "it|s a beautiful day" in flash movie.

I tried copy the xml source file into a new XML document the apostrophe ' rendered as '& # 1 4 6 ;', please help me out of here, thanks indeed.

the following picture might make the problem more understandable
Untitled-1.gif

Apostrophe Quandry
I am using a pixel font by the name of Frucade. I have always had teh best results with pixel fonts set to us no anti alias (bitmap). I am using dynamic text fields. The problem is that apostrophes show up as a missing character box when set to no anti alias, but they show up fine when set to the readability setting in flash 8. I don't like the readability option as it adds weird color artifacts, which are unacceptable in this case.

Any advice from anyone? is there something wrong with this font?

Apostrophe In A Text Field...
does anyone know how I can have an apostrophe show up in my text field when I import my .txt document?

Apostrophe In Flash MX 2004
The content of my web site is on a MySQL database. When a do an apostrophe with shift + ', it writes ' it the flash. As a solution, I was using the real apostrophe ctrl+shift+B. It was working in Flash Mx 2003 but its not workin in 2004 version. Is there somethng i can do?

Thanks a lot!

Isabelle

Apostrophe In Flash MX 2004
The content of my web site is on a MySQL database. When a do an apostrophe with shift + ', it writes ' it the flash. As a solution, I was using the real apostrophe ctrl+shift+B. It was working in Flash Mx 2003 but its not workin in 2004 version. Is there somethng i can do?

Thanks a lot!

Isabelle

How To Deal With Apostrophe's From XML Import
I have a dynamic text box that I create with createTextField. It will recieve data from an XML file. And data with apostrophes are inserting strange symbols in my text box. I've tried setting the text box properties to HTML, as you can see below, but it doesn't help. Is there a solution to this besides editing the XML?


Code:
_root.scrollingTextMc.createTextField("myTitleText", 4, 0, 0, 10, 10);
_root.scrollingTextMc.myTitleText.type = "dynamic";
_root.scrollingTextMc.myTitleText.autoSize = true;
_root.scrollingTextMc.myTitleText.embedFonts = true;
_root.scrollingTextMc.myTitleText.html = true;
//
myformat = new TextFormat();
myformat.color = 0x344139;
myformat.font = "BankGothic";
myformat.size = 18;
_root.scrollingTextMc.myTitleText.setTextFormat(myformat);

Using Apostrophe In Dynamic Text
Does anyone know a way to use an apostrophe within Dynamic Text?

CSS, Style Sheets?

The Sheets The Sheets....

How To Send An Apostrophe In Flash
i'm sending flash some variables in the form of:

"xmlPhotos.swf?userName=" & UserName & "&photoModuleID=" & PhotoModuleID

i'm having a problem where Username = "test user's". only "test user" gets sent to flash. i've tried urlencoding Username but that doesn't work. what do i need to do?

Parsing XML... Can't Handle Apostrophe's
hi, I'm parsing an xml document into dynamic text fields and the apostrophes are coming in as "+apos;". I'm not sure, but does this have to do with the UTF-8 encoded XML? I've seen other posts that deal with this topic, but my actionscript skills are really basic. I should also include that the files are being run locally on my machine. I REALLY appreciate the help! Thanks!

this is what the actionscript looks like:

var messages = Array();
// load in XML
sms = new XML();
sms.ignoreWhite = true;
sms.onLoad = function(success) {
if (success) {
var arr;
txt = "";
arr = sms.firstChild.firstChild.childNodes[1];
for (i=0; i<arr.childNodes.length; i++) {
if (arr.childNodes[i].childNodes[5].nodeName != "false") {
messages.push(arr.childNodes[i]);
txt += arr.childNodes[i].childNodes[3].firstChild+"
";
}
}
myText.text = txt;
}
};
onEnterFrame = function () { sms.load("contents.plist");};

How To Send An Apostrophe In Flash
i'm sending flash some variables in the form of:

"xmlPhotos.swf?userName=" & UserName & "&photoModuleID=" & PhotoModuleID

i'm having a problem where Username = "test user's". only "test user" gets sent to flash. i've tried urlencoding Username but that doesn't work. what do i need to do?

Apostrophe Showing Up As E&apos; ...
The XML:


Code:
<option>
<text><I steal the grue's lunch money and sneak away.</text>
</option>
The Actionscript:


ActionScript Code:
var my_xml = new XML();my_xml.ignoreWhite = true;my_xml.onLoad = function(success) {    if (success) {    //blah blah...    }}


The result:

I steal the grue&apos;s lunch money and sneak away.

How do I fix this? It's declared as UTF-8, but...

Window.open Breaks With Apostrophe
Hi All
I am using get url with window.open to open an new window to display either a flash move jpg or video. This all work great till the file name has an apostrophe in it. I do not know the names so I can not change them or even do some sort of search/replace.
url is my url varialbe wich is dynamicaly generated by coldfusion passed to flash via xml and can not be changed. it usually looks something like this


Code:
mydir1/mydir2/bob's flash.swf
if I have a file with the apostrophe it works great but files that have that it breaks. I need the pop up to be scaled with no tools etc. I have looked at resizing it in javascript wich works but cant get rid of the toolbars.


Code:
getURL("javascript:window.open('"+url+"','"+winName+"','"+"width="+w+", height="+h+",toolbar="+toolbar+",location="+location+",directories="+directories+", status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+", top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"'); void(0);");
I also tried this with removing the singel quotes but it breaks completely

Code:
getURL("javascript:window.open("+url+","+winName+",'"+"width="+w+", height="+h+",toolbar="+toolbar+",location="+location+",directories="+directories+", status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+", top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"'); void(0);");

Using Apostrophe Character In Html Text
I am importing external text using the asFunction, jumplinetext.

But I have apostrophes in the text that can't be used because they are in the asFunction code. I have tried quotes and special characters but nothing works.

Is there a way to imbed apostrophes ?

Rob Childress

Apostrophe In External Text File
G'day guys,

Sorry if this has been discussed before, but I couldn't find anything specifically about apostrophes not showing up using external text. Anyway, I discovered that if I change the text file to unselectable, it works, but I'd rather it was selectable - is there any way of doing that?

Cheers!

Boog

Apostrophe S Doesn't Show From External Text
Does anyone know why my 's disappear from my external text file?

I've embedded both Basic Latin and Punctuation.

The font I'm trying to use is Whitney Medium.

Has anyone else had a problem with this?

thanks in advance.

;b

XML Loaded Text Inconsistently Displays Apostrophe
i have a number of dynamic text fields, all of which have text loaded from their respective xml files.
one of the menu items includes an apostrophe. that apostrophe shows up in one area of the site but not in another where it is replaced by &apos; .
these two sections are identical. both dynamic text boxes with xml loaded text. one works one doesn't.
i've double checked everything. everything is embedded, i have no idea what the problem is.

any ideas?

if you want to see what i'm talking about go here and select WORK. JAMIES ORGANIC TREATS has no apostrophe because i took it out - it gets converted to &apos; in this location. but if you select JAMIES ORGANIC TREATS the name pops up in the new section correctly WITH the apostrophe.

they are separate text fields with separate xml files but all of them are treated the same.

Flash CS3 Flash Player 8 AS2
Mac 10.5

Apostrophe Doen Not Show In External Text
Any ideas on why an apostrophe will not show from an external text file. I have on SWF that calls an external text file matched with external jpg. As you roll over the image and text shows but the apostrophe get taken out..

http://loneoakdevelopment.com/page.p...hoto%20Gallery

very wierd.

PLEASE HELP SOON....

first line of the text file:
title=The Villages at St. John's Wood&blurb=This house
I have tried to set th render HTML on and off. When on, nothimg shows at all...

Apostrophe Doen Not Show In External Text
Any ideas on why an apostrophe will not show from an external text file. I have on SWF that calls an external text file matched with external jpg. As you roll over the image and text shows but the apostrophe get taken out..

http://loneoakdevelopment.com/page.p...hoto%20Gallery

very wierd.

PLEASE HELP SOON....

first line of the text file:
title=The Villages at St. John's Wood&blurb=This house
I have tried to set th render HTML on and off. When on, nothimg shows at all...

Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.

I am have having the following error:

Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs

I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.

I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.

stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);

function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;

var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);

status_txt.text = “Sending…”;

}

function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}

function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}

and the following asp.net code:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"

Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")

'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)

'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody

'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)


Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)

Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>

String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?


Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:

Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

Randomize String And Create Textfields With String Txts
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah

Convert Multiline String To A One Line String With RegExp
better get my own thread for that

How can I convert a multiline String to a one line String?
EX:

PHP Code:




Testing is always full of man made bugs.
<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank">
  <font color="#22229C">Believe</font>
</a>
me when times comes that you have to
<a href="http://www.vreate.com" target="_blank">create</a>
useless stuff to test some other useless stuff to have
<a href="http://www.vreate.com">some</a>
real results.. its a pain.
<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/>
<em>Got to try that stuff to eventually love it one day.</em>






and should result in

Code:
Testing is always full of man made bugs.<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank"> <font color="#22229C">Believe</font></a>me when times comes that you have to<a href="http://www.vreate.com" target="_blank">create</a>useless stuff to test some other useless stuff to have<a href="http://www.vreate.com">some</a>real results.. its a pain.<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/><em>Got to try that stuff to eventually love it one day.</em>


I think it have to play with the ^ (caret) and m (multiline) ... just need to put the puzzle together.

String.as (Fishing Line Or Kite String)
Hello everyone. After reading the article on Glen Rhodes (Proud Canadian) I was wondering exactly how to insert the string.as file. I have been having huuuuuuge speed issues with my code. My file sizes are quite small (40 - 60 k)but they are very sluggish.

Thank you......
Please help


http://www.moodvibe.com

Trouble With String.indexOf And String.lastIndexOf
Hi,

I have an input text field used for time. I'm trying to set it up so the user has to enter a valid time into the box.

I set the box to be only 5 characters in length and to only use numbers and the ":" character.

I thought this code would insure there wouldn't be two ":" characters and the ":" would be at lease one character from the begining and at least two from the end.

But the if you enter 2:321 it comes back as a valid time.

Thanks in advance,
thurston


Code:
if(string.indexOf(":", 1) == string.lastIndexOf(":", string.length-3) ){
trace("Valid Time");
}else{
trace("Invalid Time!!!");
}

Changing A String Name In A Loop / Concatonating String Name?
Hey all,

Does anybody know of a way to change a string name as a loop proceeds?

This is the main piece of code that I wish to loop with i incrementing, so that whilst i=0 then:

_root.barARed._visible=barRed[i];
_root.barARed._width=barLength[i];
_root.barAYellow._visible=barYellow[i];
_root.barAYellow._width=barLength[i];
_root.barAGreen._visible=barGreen[i];
_root.barAGreen._width=barLength[i];
infoA.text=info[i];

and i=2 then:

_root.barBRed._visible=barRed[i];
_root.barBRed._width=barLength[i];
_root.barBYellow._visible=barYellow[i];
_root.barBYellow._width=barLength[i];
_root.barBGreen._visible=barGreen[i];
_root.barBGreen._width=barLength[i];
infoB.text=info[i];

and so on...I would use _root.barRedInstanceName[i]._visible=barRed[i]; but I can't give the movie clip (the bar) an instance name such as redBar[1], redBar[2] etc. (system reserved I'm told)

I guess what I am trying to ask in a roundabout way: is how do you concatonate the name, rather than the contents of a string?

Hope you'll forgive me if this is something really simple that I am overlooking, but I only have a very short experience of flash.

Thanks

Al

Ball Bouncing On String: Getting The String To Be Bigger?
I have a black line which is simply a movie clip and a yellow circle which is also a movie script. The ball works great, it bounces on the bottom of the movie, and you can pick it up and throw it around. So now I want to attach the ball to the black line. So:

1. How can I make it so that the top part of the line will stay in one position, and so that a bottom part of it will move around? Is there any way I can link the two at a certain point so that wherever the ball goes the line will stay attached to it at that point?

2. In an attempt to try and reach this point I came up with this script in the ball for when it is not being dragged anywhere. The most important bit is really the bottom:


ActionScript Code:
} else {
        old.x = pos.x;
        old.y = pos.y;
        pos.x = _x;
        pos.y = _y;
        vel.x = (pos.x-old.x)*2;
        vel.y = (pos.y-old.y)*2;
        //Finds the change in position and adds that as an extention to the line:
        _root.ballstring.height += (old.y - pos.y);

Anyone reckon they could help me out? Thanks!

Keeping A String A String With Dynamic Text
I've got some dynamic text (from MYSQL & ColdFusion) that needs to be kept as a string and is (i think) being converted into a number.

The recordset is returning 8'6" (eight feet, six inches)

and my dyn text box displays 86.

Anyway around this from within Flash? I know you can strict data type in AS 2.0 but no chance of migrating this project to 2.0!

What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.

In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.

For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com


If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.

Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task

I'm currently working on this so any ideas?

Convert Html String To Xhtml String
Anyone know of a great way to convert an html string format from flash into a resembalnce of xhtml for outputing to a server or a direction i could go in to do this.

Thanks

Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah

Pass A String, Return Object With Name String
I feel like this should be pretty easy, but I 'm not quite sure how to do this...

I've got a string that is the name of a movieclip which is on the stage. I'd like to write a function which I can pass that string and have it return the object which has the instance name of that string.

Any hints?

Thanks.

John

What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.

In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.

For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com


If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.

Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task

I'm currently working on this so any ideas?

Convert Html String To Xhtml String
Anyone know of a great way to convert an html string format from flash into a resembalnce of xhtml for outputing to a server or a direction i could go in to do this.

Thanks

Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah

Complex String.split And String.substring
Hey, Im an actionscript newbie and am having a little tourble with a string.

I have a string variable containing the value:

myString = "Johnny Lewis, Danny Lopez, Alex Prince, Sandro Lee, Nick Salvage"

What I want to do is trim their last name so it only shows their first initial, so it would be converted to:

myStringTrimmed = "Johnny L, Danny L, Alex P, Sandro L, Nick S"

So im guessing I need to split it by the commas, then split those again by the blank space.

The only problem is that this variable will be dynamic and the number of people in the variable will always be different. Sometimes there will only be one name, sometimes as many as five.

Any help would be much appreciated.

String = String + If(string.length) ... + String
A few languages have an IIf() statement, which works like the if statement, but is good for use inside of strings.

Flash 8 apparently doesn't have it, but I tried something similar to this..


Code:
_global.mStruct.mString = "My first name is " +
mf.text + if(mi.text.length > 0) { ". My middle initial is " + mi.text} +
". My last name is " + ml.text + "."
And I get

"Operator '+' must be followed by an operand", referring to the red + above.

Is there a way to do this, or do I need to just break into seperate if statements and appending the value to the value of the textbox?

Thanks for any help.

How Can I Put A Number And A String Together So It Ends Up Being A String ?
How can I put a number and a string together so it ends up being a string ?


This doesn't work:
----------------------

somenumber=1;
somestring="File";

combination=somestring + somenumber;

----------------------

At the end i want to have this:

combination="File1";

Can anyone help ?

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,

LoadMovie - Target String Or Not String?
I'm trying to figure out what the major differences and/or uses for using a target as a string with double quotes or without quotes...

For example whats the difference between the following 2 lines?

1. loadMovie("products.swf",_root.dropZone);
2. loadMovie("products.swf","_root.dropZone");

I know the target in the second line is a string and the target in the first line is a MC object(?). Any other major uses for these 2 variations?

Can Trace String But Cannot Set String To Variable
Hi,

I am importing a some text values from a text file and then trying to pass this value via a function

I can TRACE the text value successfully but cannot set it to a variable.

************************************************** **************
function test(){
var aTestVariable

myData = new LoadVars()
myData.load("thenews.html")
myData.onLoad= function(success){

if(success){
trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);
}
}
return aTestVariable
}

function testFunction() {
trace(test()); //THIS DOES NOT WORK!
}
************************************************** **************


Can someone please tell me what is wrong with this:


trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);

HELP!

Rich

How Do I Insert A String Into The Middle Of Another String?
I'm going round and round in ciccles trying to figure out how to use the string functions.

All I want to do is insert a string into the middle of another one!

How do I do this?

Any help would be appreciated.

Thanks.


OM

Trouble Finding A String Is A String
I'm trying to find a certain string I provide in another string, I know that in JavaScript you can use indexOf to find it:

myString = "hello world";
findString = "world";
if(myString.indexOf(findString) >= 0) {
alert("found");
}

I tried that in flash (replacing alert with trace) and it doesn't work

can anyone help???

Can't Pass String To Nc.connect(string)
hey guys. fairly new to flash, but I've managed to throw together a player with info and tutorials from here and other places. I've got everything just how I want it save for one problem. I've got an XML file that I get the URL for my server from and also get the names of videos to populate a list. Here's the problem:
I can get the URL into a string in my program (it traces fine). However, when i try to pass that string in my nc.connect(string) it doesn't work. Everything loads fine, but when you click a video, it can't connect to it. If I manually enter the URL into the connect field like this: nc.connect("rtmp://url") it works fine.
So am I missing something? Why can it take the URL manually entered and not from a string?

Find A String In A String Chaine
Hi, I need a function that detects if a string was found inside another string:

here's an example:
string1 = "ABC"
string2 = "FGABCJHG"

in this case, the function would return true...
any ideas on how to make this? i m being lazy, i could try to do it by myself but sometimes this kind of functions were already made by someone and they are in internet or whatever.

thanks!

Need To Parse String But Not Literal String...
Once again I have run into something....

Here is the start of the code:
CODEvar target = this.onStage.allNotesOnStage.easyArray
var randomNum = Math.floor(Math.random() * (max - min + 1)) + min;
var showNote = target[randomNum];

Remove String (string Var - String Var )
hi guys ,
i need to remove a string to an other string

here a simple example


ActionScript Code:
var test1 = "test.allo255"
var test2 = "test.allo"
 
trace(test1)
trace(test2)
 
trace(eval(test1-test2))

i need to catch the number at the end

or remove the string part
(or even just a part , like if i can remove "test." and hang up with "allo255" its ok too)


here what i got ,

my output is

ActionScript Code:
_level0.my_sp.spContentHolder.img_mc5


i need to grab only "img_mc5" or only the # "5"

plz and a big tnx in advance

Copyright 2005-08 www.BigResource.com, All rights reserved