all groups > flash actionscript > march 2006 >
You're in the

flash actionscript

group:

String.replace();


String.replace(); ogre11
3/2/2006 11:38:13 PM
flash actionscript:
so i see a replace method in the string class but it returns undefined and its not listed in the actionscript 2.0 documentation for the string class

Re: String.replace(); NSurveyor
3/2/2006 11:53:48 PM
There is no replace method? But you can use split and join to replace text
(many times in one line, btw). For example:

my_str = "I like dogs because they bark; dogs rule!";
new_str =
my_str.split("like").join("hate").split("dogs").join("people").split("bark").joi
n("talk").split("rule").join("are terrible");
trace(my_str);
trace(new_str);
Re: String.replace(); Jeckyl
3/3/2006 12:00:00 AM
[quoted text, click to view]

There is NO replace method in the String class.

The only methods are:

substr
split
substring
slice
lastIndexOf
indexOf
concat
charCodeAt
charAt
toLowerCase
toUpperCase
toString
valueOf

Plus the method inherited from the Object class

[quoted text, click to view]

You're confused, I think :)
--
Jeckyl

Re: String.replace(); Jeckyl
3/3/2006 12:00:00 AM
As per the comment in that file ... this is only in the Central player ..
which has function not available in Flash Player. It is not part of Flash
unless you are using Central.
--
Jeckyl

Re: String.replace(); ogre11
3/3/2006 12:41:38 AM
this is from the string class file in my first run folder

intrinsic class String
{
var length:Number;

function String(value:String);

static function fromCharCode():String;

function charAt(index:Number):String;
function charCodeAt(index:Number):Number;
function concat(value:Object):String;
function endswith( endString:String ):Number; // Central API
function indexOf(value:String, startIndex:Number):Number;
function lastIndexOf(value:String, startIndex:Number):Number;
function replace( re:String, repl:String ):String; // Central API
function slice(start:Number,end:Number):String;
function split(delimiter:String, limit:Number):Array;
function substr(start:Number,length:Number):String;
function substring(start:Number,end:Number):String;
function toLowerCase():String;
function toString():String;
function toUpperCase():String;
function valueOf():String;
}
Re: String.replace(); blemmo
3/3/2006 1:07:25 AM
Seems to be part of another MM product:
http://www.macromedia.com/software/central/. It uses another player and, as it
seems, an extended API. But I don't know anything more about that...

hth,
blemmo
Re: String.replace(); ogre11
3/3/2006 1:21:20 AM
AddThis Social Bookmark Button