flash on 2011-6-3
♥0 |
Line 22 |
Modified 2011-06-03 08:09:36 |
MIT License
archived:2017-03-20 12:02:14
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/81AV
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
public class FlashTest extends Sprite {
private var tf:TextField;
public function FlashTest() {
tf = new TextField();
tf.height = 300;
tf.width = 500;
addChild(tf);
// write as3 code here..
var data:String = "Lorem ipsum dolor #sit_amet, consetetur sadipscing, sed #diam-nonumy eirmod tempor #invidunt ut labore #et";
var regex:RegExp = /(\#[a-zA-Z0-9_%-]*)/g;
var result:Object;
while (result = regex.exec(data)) {
trace(result[0]);
}
}
public function trace(t:*):void{
tf.appendText(t + "\n");
}
}
}