all groups > macromedia mobile and devices flashlite > february 2005 >
You're in the

macromedia mobile and devices flashlite

group:

substring()


substring() Avich
2/2/2005 1:32:05 PM
macromedia mobile and devices flashlite: Substring is supposed to be suported in flash lite but when I publish the movie
in a flahlite1.1 player I get a meesage that I need a flash player 5 for
"substring()"

so is it suported or not?

thanks
Re: substring() vgslag
2/2/2005 2:01:06 PM
If you check the usage you will see its:

substring(string, index, count);

I assume you're trying to use:

string.substring(index, count);

Re: substring() ecma32
2/2/2005 2:02:20 PM
hi,

flashlite 1.1 player does support the substring()

try this code

str="some text"
txt=substring("str",0,3)
trace(txt)

Re: substring() jganderson
2/2/2005 9:05:44 PM
Just looked at your code, ecma32.

For some reason the substring() function in FL 1.1 doesn't work as it should.

For your example

str="some text"
txt=substring("str",0,3)

I'm assuming you want to assign the substring to the words "some text" and
return the word "some".

In which case, the following code will work:

str="some text";
txt=substring(str,1,4);
trace(txt);

***Explanation***

In your example where you have stated '0' - the starting position for the
string, this is not the index value. Same goes for '3'.

These values are the absolute positioning in the string and not the index
(like say in an array).

Also - str - doesn't need quotes as it's the variable.











txt=substring("str",0,3)
trace(txt)

enjoy
Re: substring() Avich
2/3/2005 8:16:19 AM
THanks guys, I found it in the end.
AddThis Social Bookmark Button