flash on 2010-9-10
♥0 |
Line 24 |
Modified 2011-01-03 18:36:52 |
MIT License
archived:2017-03-20 12:02:19
ActionScript3 source code
/**
* Copyright grapefrukt ( http://wonderfl.net/user/grapefrukt )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/jsh1
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
import Namespace;
public class FlashTest extends Sprite {
private var tf:TextField;
public function FlashTest() {
tf = new TextField();
tf.height = 300;
tf.width = 500;
addChild(tf);
var myPattern:RegExp = /\[video\]([a-zA-Z0-9_-]+)\[\/video\]/g;
var str:String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. \n[video]AAAAAAAAAAA[/video]\nDonec commodo condimentum enim, vitae consectetur felis pharetra a.";
var result:Object = myPattern.exec(str);
while (result != null) {
trace( "id is: " + result[0] + " at index: " + result.index);
result = myPattern.exec(str);
}
}
public function trace(t:*):void{
tf.appendText(t + "\n");
}
}
}