Send this to a friend
1 String.prototype.explode = function(separator:String) {
2 var string = this;
3 var list = new Array();
4
5 if (separator == null) return false;
6 if (string == null) return false;
7
8 var currentStringPosition = 0;
9 while (currentStringPosition<string.length) {
10 var nextIndex = string.indexOf(separator, currentStringPosition);
11 if (nextIndex == -1) break;
12 var word = string.slice(currentStringPosition, nextIndex);
13 list.push(word);
14 currentStringPosition = nextIndex+1;
15 }
16 if (list.length<1) {
17 list.push(string);
18 } else {
19 list.push(string.slice(currentStringPosition, string.length));
20 }
21 return list;
22 }
23
24 var mystring = "test1 - test2";
25 exploded = mystring.explode(" - ");
26 trace (exploded[0]);
String.prototype.explode = function(separator:String) {
var string = this;
var list = new Array();
if (separator == null) return false;
if (string == null) return false;
var currentStringPosition = 0;
while (currentStringPosition<string.length) {
var nextIndex = string.indexOf(separator, currentStringPosition);
if (nextIndex == -1) break;
var word = string.slice(currentStringPosition, nextIndex);
list.push(word);
currentStringPosition = nextIndex+1;
}
if (list.length<1) {
list.push(string);
} else {
list.push(string.slice(currentStringPosition, string.length));
}
return list;
}
var mystring = "test1 - test2";
exploded = mystring.explode(" - ");
trace (exploded[0]);
Send this to a friend
1 <object type="application/x-shockwave-flash" data="images/banner.swf" width="288" height="128">
2 <param name="movie" value="images/banner.swf" />
3 <img src="banner.gif" width="288" height="128" alt="banner" />
4 </object>
<object type="application/x-shockwave-flash" data="images/banner.swf" width="288" height="128">
<param name="movie" value="images/banner.swf" />
<img src="banner.gif" width="288" height="128" alt="banner" />
</object>
Send this to a friend
a simple sample
1
2
3 for (var i in holder) {
4 if(typeof(holder[i])=="movieclip" && holder[i]._name.substr(0,4)=="foo_") {
5 holder[i].removeMovieClip();
6 }
7 }
8
9 for (var i=0;i<noOfclips;i++) {
10 var clip=_root["mc"+i];
11 clip.removeMovieClip();
12 }
13
14 for (var n in this) {
15 removeMovieClip(this[n]);
16 }
for (var i in holder) {
if(typeof(holder[i])=="movieclip" && holder[i]._name.substr(0,4)=="foo_") {
holder[i].removeMovieClip();
}
}
for (var i=0;i<noOfclips;i++) {
var clip=_root["mc"+i];
clip.removeMovieClip();
}
for (var n in this) {
removeMovieClip(this[n]);
}