you are in: codestackercodes [RSS] → tag: flash [RSS]

explode function like php Delicious Email

show/hide lines
   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]); // returns 'test1'
created by leozera — 09 December 2008 — get a short url — tags: actionscript flash prototype embed

valid Flash example for XHTML 1.0 Strict (XHTML 1.1) Delicious Email

show/hide lines
   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>
created by leozera — 21 July 2008 — get a short url — tags: embed flash xhtml embed

remove all movieclips Delicious Email

a simple sample

show/hide lines
   1  // 3 solutions
   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  }
created by anonymous — 04 July 2008 — get a short url — tags: actionscript flash movieclip embed